Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering data in a report via the Report Form command
Message
From
09/08/2001 15:30:43
 
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00541954
Message ID:
00541957
Views:
20
Stuart-

>I would like to know how to filter data in a report. I have used the follwoing syntax to call the report from within my program:
>
>REPORT FORM MyReport TO PRINT
>
>I read that you can use this command to send a filter to the report. How do I do this? And how do I tell the report to expect the filter for a particular field? If I add the following to the report command "FOR status_val = 'Y' ", what do I need to change or add in the report so that it will filter the data for the value I sent? Does this field name have to be a field on the report?

Are you talking about the FOR, WHILE, and RANGE clauses of the REPORT FORM command?
REPORT FORM FileName1 | ? [ENVIRONMENT] [Scope] [FOR lExpression1]
[WHILE lExpression2] [HEADING cHeadingText] [NOCONSOLE]
[NOOPTIMIZE] [PLAIN] [RANGE nStartPage [, nEndPage]]
[PREVIEW [[IN] WINDOW WindowName | IN SCREEN] [NOWAIT]]
[TO PRINTER [PROMPT] | TO FILE FileName2 [ASCII]] [NAME ObjectName]
[SUMMARY]

>
>Can you send values throught to the report that don't affect the data?

Not sure what this means.

> For example a different name for the report depending on the filter criteria. How do I pick this up in the report.

Does the HEADING clause in the above command work?

Otherwise, you can set up private variables in your code before you call your report that the report can use.

As for filtering the data, the "best practice" for doing reports is to build a SQL-SELECT of exactly the data you want to report on in the calling code and have the report refer to field names w/o an alias.
Previous
Reply
Map
View

Click here to load this message in the networking platform