Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run code in report form
Message
From
12/01/2009 15:41:03
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01372806
Message ID:
01372939
Views:
17
>>>>I want to be able to run a block of code in the report form when it first starts. How can I do that? The reason is that for this particular report, I want to run SQL against the current alias and create a generic cursor (Fld001, Fld001, etc.). This cannot be done in code priort to the REPORT FORM statement in the calling code.
>>>
>>>I have always placed embedded code in the Init and Destroy events. Right-click on the Report Design and select Data Environment. Right-click in the DE and select Properties. From the Properties dialog you then select code editor for the event. I generate my cursor in the Init event and close them in the end. Be sure to set the Data Session to Public so the report can see the already open tables and cursor.
>>
>>I like it and it works. Except for this. I put this code in the INIT:
>>
>>m.CurrentAlias = ALIAS()
>>m.CurrentRecNo = RECNO()
>>
>>And this in the Destroy:
>>
>>SELECT (m.CurrentAlias)
>>GOTO m.CurrentRecNo
>>
>>But they are out of scope in the Destroy. If it were a form, I would create a form property to hold them, but I did not see this for the report.
>
>The variables have to be public. You need to release them in Destroy.

What if they are defined in the report variables section? I HATE using public variables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform