Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_pagetotal when chaining reports
Message
From
22/08/2007 10:37:05
Bruno Maddalozzo
Informatica Aziendale
Arsie, Italy
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01249536
Message ID:
01249574
Views:
16
Is this good the same or has it hidden problems? :
LOCAL lnPages, lcTemp
lnPages = 0
WAIT WINDOW 'Preprocessing report...' nowait
*
*here code to create the listener
*then...

ReportListener.ListenerType = -1  &&no output

REPORT FORM Report1 Object ReportListener NOPAGEEJECT
REPORT FORM Report2 Object ReportListener NORESET
lnPages = _PAGETOTAL

ReportListener.ListenerType = 1  &&preview

REPORT FORM Report1 Object ReportListener NOPAGEEJECT
REPORT FORM Report2 Object ReportListener TO PRINTER PROMPT PREVIEW NORESET
It avoids creating files. I did some test and seems ok.


>You have to preprocess the report yourself and use your own variable .. not the system variable. Use this code to run the report and in the report use lnPages instead of _PAGETOTAL.
>
>
>LOCAL lnPages, lcTemp
>lnPages = 0
>lcTemp = FORCEEXT(SYS(2015), '.txt')
>
>WAIT WINDOW 'Preprocessing report...' nowait
>REPORT FORM Report1 NOCONSOLE TO FILE &lcTemp NOPAGEEJECT
>REPORT FORM Report2 NOCONSOLE TO FILE &lcTemp NORESET
>lnPages = _PAGETOTAL
>ERASE (lcTemp)
>WAIT CLEAR
>
>REPORT FORM Report1 TO PRINTER PROMPT PREVIEW NOPAGEEJECT
>REPORT FORM Report2 TO PRINTER PROMPT PREVIEW NORESET
>
>
>
>
>>I'm chaining two reports, using the report listener.
>>Let's say:
>>ReportA, which produces 20 pages
>>ReportB, which produces 5 pages.
>>I've the need to print all pages with page numbering x/y i.e.
>>page 1 of 25, 2 of 25 ...
>>I can't use _pagetotal, which always return 20 after ReportA is processed
>>so I would get
>>Page 20 of 20 and then page 21 of 25 (when ReportB is processed).
>>How can I get _pagetotal keep the whole page count?
>>
>>TIA
>>Bruno
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform