Question
“How can I skip the first X number of labels on a sheet, so that my users can reuse label sheets?”
Solution
The following exmple shows how to use the DetailBand.BandsPerRecord to to skip X number of labels.
Download: SkipLabels.zip
Download: SkipLabelsLeftToRight.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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
procedure TForm1.btnPreviewClick(Sender: TObject); begin // get number of labels to skip plus one FSkipCount := StrToInt(Edit1.Text) + 1; ppReport1.Print; end; procedure TForm1.ppReport1StartPage(Sender: TObject); begin // configure report to generate SkipCount number of empty labels if ppReport1.AbsolutePageno = 1 then begin ppReport1.DetailBand.BandsPerRecord := FSkipCount; FBandsPerColumn := 0; ppDBCalc1.Visible := False; ppDBText1.Visible := False; end; end; procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject); var liBandsGenerated: Integer; begin // calc number of bands generated liBandsGenerated := ((ppReport1.CurrentColumn - 1) * FBandsPerColumn) + ppReport1.DetailBand.Count; // determine whether to start generating labels if (liBandsGenerated = (FSkipCount - 1)) then begin ppReport1.DetailBand.BandsPerRecord := 1; ppDBCalc1.Visible := True; ppDBText1.Visible := True; end; end; procedure TForm1.ppReport1EndColumn(Sender: TObject); begin // calc bands per column if (FBandsPerColumn = 0) then FBandsPerColumn := ppReport1.DetailBand.Count; end; |