Hi Helmut,
I am nor sure if this is the best way, I will
probably find that I am a dummy and that there is a really easy way and
everyone then thinks I am a klutz.
- Create a dummy report on a panel unrelated to the report. Preferably the panel should have only one record or alternatively you will need to put a test so that the report will stop after one record. eg set RV1 = 0 and STOP report if RV1 is False (this report will be used as a holder for the real report which will be put in a subreport)
- Set RV3 = 0 (this will be our page counter)
- In the First Page header for that report set say RV2 = "nul"
- Still in the FirstPage Header
- Turn Print OFF
- Open FileName in RV2 (ie begin writing to the file called "nul" which is a nothing file)
- Turn File On
- The above 3 steps ensure that the report gets processed (just turning Print Off stops the print output counter, but printing to a file keeps it going, even if the file is "nul" meaning it will process but its output will evaporate into thin air)
- In the Report Body add a Virtual Link to a SubReport, ie the panel you would have normally based this report on (use whatever index you want, and do not use any link fields or link variables). Create the report as you normally would, with all of its features, subreports etc.
- In the Page Footer section of this Subreport, include a formula RV3 = RV3 + 1 (this will increment every time a page is output, even though in reality there is nothing coming out)
- After this SubReport finishes you will have the number of pages for the subreport in RV3.
- Turn File OFF
- Turn Print On
- Repeat the exact subreport ( but this time the data will be being output to the printer)
- In the Page Footer of this really outputted report include Page Number of RV3 Pages
- You might will have to keep track that you do not add any extra lines such as in the page footer, and if so you need to replicate it in the dummy first time subreport.
- Also so you can build the subreport the first time around you will probably will need to put the Print Off and nul file thingies in after you have the report working
In essence you are creating a container where you
can run the same report twice. For the first time through you are suppressing
the output, but keeping track of the incrementing page counter, and the second
time though you are outputing the real stuff with the benefit of
hindsight.
I know this looks a little clumsy and if the first
subreport is very complex, having to repeat it verbatim a second time might be
very daunting... If it is very daunting, but very important that you get
the page numbering right then it might be easier to just create the one
subreport, and get it perfect, and then create an empty shell for the second
subreport. Using DPEXP export to an .STE file, edit it with your favourite
text editor and find the first SubReport and Copy and Paste it, into the
location of what is the empty shell of the second subreport, and the DPIMP it
all back together. Backup everything before doing this!!! If the
planets properly align it will all work smoothly
Bye
Brian
----- Original Message -----
From: ""Dr. Helmut Dörbecker"" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, October 13, 2006 6:21 PM
Subject: [Dataperf] total of pages in a
report
> Is it possible to get the total number of pages at the beginning of the
> report for a printout on every page with "page-number" of "number of pages"?
> You would help me enormous.
> Helmut
> _______________________________________________
> Dataperf mailing list
> [email protected]
> http://lists.dataperfect.nl/mailman/listinfo/dataperf
>
_______________________________________________ Dataperf mailing list [email protected] http://lists.dataperfect.nl/mailman/listinfo/dataperf
