How do I print the copy number when I have a report with one page and in the
printer dialog I specify about printing several copies and I want every copy
number to appear printed in every page?
For Example:
Page 1 -> Copy 1
Page 2 -> Copy 2
and so on
Thanks
Comments
Tech Tip: Printing a Unique Caption for each copy of
of a multi-copy report sent to the printer.
-------------------------------------------------------
Here's example of sending 3 copies to the printer and printing a unique
caption for each one.
1. Set Report.PrinterSetup.Collation to True
2. Set Report.PrinterSetup.Copies to 3
3. Set the Report.PassSetting to psTwoPass. (add ppTypes to your "uses"
clause)
4. Create a private variable in your form: FCopy
5. In the Report.BeforePrint event code
FCopy := 0;
6. In the Report.OnStartPage event code
if ppReport1.SecondPass and (ppRepor1.AbsolutePageNo = 1) then
Inc(FCopy);
7. Add a Label to the Report and in the OnPrint event code something like:
case FCopy of
1: ppLabel1.Caption := 'Shipping';
2: ppLabel1.Caption := 'Order Processing';
3: ppLabel1.Caption := 'Account Receivable';
end;
--
Tech Support mailto:support@digital-metaphors.com
Digital Metaphors http://www.digital-metaphors.com
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
using the calc tab. Is that the same? because it didn?t work. Showld I
check another thing on the configuration?. Programing these steps directly
on the report file (.rtm) works as in the application?
Thanks
using the calc tab. Is that the same? because it didn?t work. Showld I
check another thing on the configuration?. Programing these steps directly
on the report file (.rtm) works as in the application?
Thanks
For future reference, please post RAP oriented questions in the RAP
newsgroup. This helps us understand what the problem is and allows us to
give you a more accurate answer in less time.
The tech tip posted is all psuedo code however looking at it, I do not see
very many items that are not natively available in RAP. My first suggestion
would be to get this working in Delphi so you can debug any errors or
mistakes. Then try moving the code to RAP. A couple of notes...
- When setting the PassSetting in RAP, you will use the boolean properties
Report.FirstPass and Report.SecondPass.
- You should declair FCopy in the Declarations | Variables section of the
code module.
- Instead of using the Delphi Inc() routine, simply use value := value + 1;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Here is a RAP example that I created. The Report BeforePrint event only
fires prior to the first time you print or preview in RAP (where as in
Delphi it will fire once for preview, again for print, etc.). Therefore I
added a PrintDialogClose event-handler that resets the copy counter to 0.
Other than that it is the same as in Delphi.
www.digital-metaphors.com/tips/CopiesCaptionsRAP.zip
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com