>Is it Possible to pass parameters to VFP report?
>Note:- I don't want to use public variables.
I usually use a wrapper program that I can use to get parameters from a user and then have them available to a report. A simple example would
be;
PROCEDURE TheReport
PRIVATE pdStartDate, pdEndDate
pdStartDate = { / / }
pdEndDate = DATE()
oParamForm = CREATEOBJECT("someform to get start/end date parameters")
=GetRptParams()
=DoRpt()
RETURN
PROCEDURE GetRptParams
oParamForm.txtStartDate.ControlSource = "pdStartDate"
oParamForm.txtEndDate.ControlSource = "pdEndDate"
oParamForm.Show(1)
RETURN
PROCEDURE DoRpt
SELECT * ;
FROM sometable ;
WHERE BETWEEN(somedate,pdStartDate,pdEndDate) ;
INTO CURSOR RptCursor
IF _TALLY > 0
REPORT COMMAND
ENDIF
USE
RETURN
The report definition usually will have in it's header a label and
textbox that has the following; From pdStartDate To pdEndDate
Because pdStartDate and pdEndDate were defined as Private in the wrapper
program, they are visible to the report definition. And when this
program ends, they are destroyed, no publics are used and no app
properties are needed.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only