rbWiki > Design > Labels > How To...Repeat Labels

How To...Repeat Labels

Table of contents
  1. 1. Question 
  2. 2. Solution

Question 

"How can I print X number of labels for each record?" 

Solution

This example shows how to use the DetailBand.BandsPerRecord property to print X number of labels for each record.

Download: RepeatLabels.zip 

Sample Delphi code:

procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
var
  liCount: Integer;
begin

  {check BandsPerRecordCount, it resets to 1 when all bands for the
      prior record have gemerated }
  if (ppDetailBand1.BandsPerRecordCount = 1) then
    begin
      liCount := Round(ppReport1.DataPipeline['CustNo'] div 1000);

      ppDetailBand1.BandsPerRecord := liCount;
    end;

  // show a counter next to each label
  ppLabel4.Caption := IntToStr(ppDetailBand1.BandsPerRecordCount);

end;
Tags
none

Files (0)

 
You must login to post a comment.