Write "copy" on the second print
Hi
I have a report with 4 sub reports and a line break
When I print this report I want to print two copies, and on the second set add a Watermark saying "copy"
I've placed a label on my report which I'm trying to show or hide.
The following is part of a POC project (hence the bad naming)
var
AbsolutePageCount : Integer = 0;
procedure TForm2.Button1Click(Sender: TObject);
begin
AbsolutePageCount := 0;
ppReport1.Print;
end;
procedure TForm2.ppReport1StartPage(Sender: TObject);
begin
inc(AbsolutePageCount);
WaterMark.Visible := AbsolutePageCount > 2;
end;
If I stop the program on my Inc line It works fine, I get my Watermark on page 3 and 4, but when running the program without breakpoint I only get my Watermark om page 4
I have a report with 4 sub reports and a line break
When I print this report I want to print two copies, and on the second set add a Watermark saying "copy"
I've placed a label on my report which I'm trying to show or hide.
The following is part of a POC project (hence the bad naming)
var
AbsolutePageCount : Integer = 0;
procedure TForm2.Button1Click(Sender: TObject);
begin
AbsolutePageCount := 0;
ppReport1.Print;
end;
procedure TForm2.ppReport1StartPage(Sender: TObject);
begin
inc(AbsolutePageCount);
WaterMark.Visible := AbsolutePageCount > 2;
end;
If I stop the program on my Inc line It works fine, I get my Watermark on page 3 and 4, but when running the program without breakpoint I only get my Watermark om page 4
Comments
I'm not able to verify your license status, please send license details to support@. Include Company, Contact, email, serial number.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Try using Report.AbsolutePageNo, that property returns the current PageNo being generated.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
how can i do this by archive-Files?
For archives, you will want to use the OnReadPage to add/remove drawcommands from the page object. Since archive files do not contain report components, you will need to add a drawcommand manually as needed. See the following example on creating a watermark drawcommand and adding it to a page.
http://rbwiki.digital-metaphors.com/delphi-code/formatting-delphi-code/how-to-manually-add-a-watermark-to-a-page/
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com