Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering data in a report via the Report Form command
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00541954
Message ID:
00541964
Vues:
8
>REPORT FORM FOR status_val='Y' TO PRINT
>As long as the fields that you want on your report are present in the results of the table that you are reporting against, you don't have to change any field names. The FOR clause can be on a field other than that in the report.
>
>
>To send values to the report, for display, just define a public variable and then add that public variable to the report form. For example:
>
>lcTitle="Title of My Very Important Report"
>

Larry,

A small correction: don't need to use public variables. Local variables from form would work just fine. They should work from program too, but recently we found a situation, where they didn't, so just in case, you may declare them to be private, if report is called from the program.

Also I agree, that it's better to prepare needed records in advance (via SQL, filter or filtered index) rather than rely on FOR clause in Report.
>Then make sure there is field called lcTitle defined in the report header.
>I do this all the time with titles and date ranges,and other criteria so that people know what results they are looking at with the report.
>
>Also, I usually run a SELECT statement into a cursor to get my information for the report. This allows more complex queries, or a series of queries even, and eliminates the use of the FOR statement in the REPORT FORM clause.
>
>--- Larry
>
>
>
>>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?
>>
>>Can you send values throught to the report that don't affect the data? For example a different name for the report depending on the filter criteria. How do I pick this up in the report.
>>
>>Thanx
>>Stuart
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform