Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select page to print
Message
 
 
To
20/05/2001 02:29:51
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00509177
Message ID:
00509214
Views:
19
>In allowing my users to select page number to print a report,
>I had tried to obtain the past page number by including
>the following statements in the init event of the form:
> REPORT FORM MyReport TO SCREEN NOCONSOLE
> lastPage = _pageno
>


>Every time the report is printed. The init event would execute
>the above but the following message appeared:
>
> "Screen.txt already exists, overwrite it ? Yes/No"
>
>My Q's are:
>1. Can I get away without this appearing every time the above
> REPORT command is executed?
>
>2. Where is the best place to put this REPORT FORM NOCONSOLE
> statement so that I don't have to re-generate the past page everytime
> I print the report.
>
>3. Is there a more appropriate (or simple) way to obtain the last page
> than the REPORT command ?
>
>Thanks for any help in advance.

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
Where are other ways, which based on calculations, but I think, this way is simplest, though for big reports this process may take time...

Check FAQ section here...
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform