Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing report variable by reference to a function
Message
De
28/11/2008 09:17:59
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01364082
Message ID:
01364491
Vues:
11
>>
>>Reports are scoped to have access to any variables that the calling program or form or class had at the time the report was run. For example .. if you have a PRG with this code:
>>
>>LOCAl lnValue
>>lnValue = 10
>>REPORT FORM MyReport TO PRINTER PROMPT PREVIEW
>>
>>You could put lnValue as the expression in a field on the report it will print the number 10.
>>
>>That said ... please explain a little bit more of what you are trying to accomplish. There might be a better way to do it.
>
>What I was trying to do is what Dragan calls "intelligent" report. Here is a brief description.
>
>I have a report in my vertical market application. The report cursor is created in a form, once user enters his/her criteria for the report. The base for the report is a cursor created from a table (kind of simplified as in example of P.O. Header).
>
>Then comes one customer who wants to include in the report records from the table related to the report base table (e.g. P.O. Header -> P.O. Lines). So instead of changing the base SQL select for the report cursor (to include line items and then group) I wanted the report to "get" related data on-the-fly. So that for every line in the report there would be a call to a function that would get the record(s) from the related table. I have actually done it already in one other report and it works. But there I was retrieving just one field from the related table. Now I need to retrieve more than one field. This is where the idea of calling a function and storing some values in report variables came to mind.
>
>I really don't want to (and don't have time) to change the report SQL Select engine. So I either will have to come up with a way to create an intelligent report or tell the customer to wait when I have more time.
>
You could declare form (or any other) object LOCAL before you call Report Form and then use any object method/properties in the report.
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform