Question
“How do I display a unique caption for each copy of my report?”
Solution
ReportBuilder 11 introduced two copy related options to the System Variable component. Placing this component on your report and setting it to CopyNo or CopyNoDesc will display the copy number on each separate copy of the report.
If more customization is needed, see the example below on manually creating unique captions for each copy of the report.
Download: UniqueCaptionForEachCopy.zip
Download: UniqueCaptionForEachCopyRAP.zip
Sample Delphi code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
procedure TForm1.ppReport1BeforePrint(Sender: TObject); begin FCopy := 0; end; procedure TForm1.ppReport1StartPage(Sender: TObject); begin if ppReport1.SecondPass and (ppReport1.AbsolutePageNo = 1) then FCopy := FCopy + 1; end; procedure TForm1.ppPageStyle1BeforePrint(Sender: TObject); begin if (ppReport1.PrinterDevice = nil) then begin FCopy := 0; ppLabel1.Visible := False; end else begin ppLabel1.Visible := True; ppLabel1.Caption := 'Copy ' + IntToStr(FCopy); //or custom caption end; end; |