Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select page to print
Message
From
20/05/2001 14:17:02
Kam Lee
SUNY-Health Science Center
Brooklyn, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00509177
Message ID:
00509228
Views:
22
>>In the procedure, which calls your report, put
>>private nLastPage
>>nLastPage=0
>
>>In Init of your report you can put:
>
>> if vartype(m.nLastPage)="N"
>> if m.nLastPage>0 && Last Page was already calculated
>> else
>> report form myReport to file dummy.txt noconsole
>> nLastPage=_pageno
>> erase dummy.txt
>> endif
>> else
>> && Should never happend, but if it's, the calling procedure doesn't set >this property
>> endif
>
>Nadya,
>
>I will not call the report from with the Init of the report. This may get
>into an infinite loop.
>I would rather do it in 2 report form statements:
> report form myreport NOCONSOLE
> M.nLastPage=_pageno
> report form myreport TO PRINT NOEJECT NOCONSOLE NOWAIT
>
>Kam.

>>>How does the above code execute an infinitive loop? Actually, I never use >>>Report DE too... Basically, if the report is called by the form and the data >>>for the report would not change during life of this form, we can add a new >>>property to the form nTotalPages, initialize it to 0. Then in the procedure, >>>which calls the report, check for this form property, so we would not need >>>to call this report to dummy file (I use this technique always instead of >>>screen, since it provides more accurate result) more, than it's needed...

Nadya,
In a multi-user environment, data change at any minute meaning total pages of a
report can change anytime. We can't store the value of the total page of a report for later use in that manner. Init event of a report DE is fired whenever the report is called. Doing report form myreport within the Init event of the same report will get into infinite loop.
Doing report form 2 times in a row as I indicated still has the risk of getting
incorrect total page but most of the time we can get away with that.
Kam.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform