Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the cursor within the report...
Message
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00234116
Message ID:
00234173
Views:
31
>>One thing you can do is to remove the tables from the dataenvironment. You can then put code in the report's dataenvironment init method to do a sql select from whichever table you want. That cursor will then be used in the report.
>>
>
>But How do I gain access to the report DE programatically?

You can't from another program as far as I know.

Here is what I do.

Put up a form that collects the parameters to send to the report. In the forms print button I have the code

REPORT FORM repEvanReport NOCONSOLE TO PRINTER PROMPT

In the init method of the report's dataenvironment I then open the tables, do selects necessary to run the report



* open tables
use cThis shared in 0
use cThat shared in 0
use cTheOther shared in 0

* do different select statements based on different reports
If lcReport type = "1"
SELECT blah from cThis ...
....
ELSE
SELECT goober from ....
....
ENDIF

* make sure the final data is put into a cursor like cReport
* select that cursor
SELECT cReport

In the DESTROY method of the report's DE close all of the cursors

Does this help?

This way all of your code stays with the report. Makes it more self documenting. An added bonus is that you can preview the report during development.
Previous
Reply
Map
View

Click here to load this message in the networking platform