Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing report variable by reference to a function
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01364082
Message ID:
01365082
Views:
14
>
>You could put code in the OpenTables method of the report to create a second cursor with all the extra fields you need. Set a relation to the main cursor so that the new cursor is always on the appropriate record. In your report, you can just reference the data in the new cursor. Here's an example of the code in OpenTables.
>
>
>NODEFAULT && This stops the native behavior of opening tables after all this code is processed.
>SELECT **** FROM *** INTO CURSOR tmpExtraStuff
>INDEX ON *** TAG *** 
>DODEFAULT() && This forces the tables to be opened in the DE to be opened now 
>SELECT This.InitialSelectedAlias
>SET RELATION TO ** IN tmpExtraStuff
>
>
>If you don't open tables in the DE, you could do something like this:
>
>
>lcAlias = ALIAS() && Get the current alias
>NODEFAULT && This stops the native behavior of opening tables after all this code is processed.
>SELECT **** FROM *** INTO CURSOR tmpExtraStuff
>INDEX ON *** TAG *** 
>DODEFAULT() && This forces the tables to be opened in the DE to be opened now 
>SELECT (m.lcAlias)
>SET RELATION TO ** IN tmpExtraStuff
>
>
>Now in your report add objects with expressions such as tmpExtraStuff.Field1, tmpExtraStuff.Field2, etc.

This is very interesting approach. I didn't know of method OpenTables in the report. I will try this approach. Thank you very much.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform