Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reports & Parameters
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00022551
Message ID:
00022641
Views:
31
>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
Map
View

Click here to load this message in the networking platform