Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

BandsPerRecord = 0

edited November 2004 in General
Delphi 7 Pro
RBuilder 7.04 Pro

Hi!
I use the folowwing code in the "RecordPositionChange" event of the
BDEPipeLine to print X times the same row, where X is a value of the Dataset
(for example, for printing labels by stock).

procedure TForm5.ProductsPipeLineRecordPositionChange(Sender: TObject);
begin
try
report.Detailband.BandsPerRecord:=ProductsPipeLine.DataSource.DataSet.fieldbyname(
'stock' ).asinteger;
except
report.Detailband.BandsPerRecord:=1;
end;
end;

All works fine! BUT if the stock of one of the products is "0", it will
print 1 Label instead. How can I skip it or not to print labels where STOCk
field = 0 in this event?

Thanks!

Comments

  • edited November 2004
    Hi Santy,

    Setting the TppDetailBand.BandsPerRecord proeprty to 0 simply disables the
    functionality of this property. If you would like to remove the detail band
    completely when there are no records, you will need to toggle the visibility
    of that band in the Band.BeforePrint event.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2004
    Hi, Nico...

    I can't toggle the visibility in the BeforePrint event because I use saved
    .rtm reports.
    I have solved the problem calling the ProductsPipeLine.Next to skip those
    records where STOCK <= 0

    Thanks


This discussion has been closed.