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

how to print no records when table.recordcount = 1

edited April 2002 in General
I'm trying to print no records in the detail band of my reports if the
table.recordcount of its datapipeline is equal to 1.

I have tried PageLimitReached in many events but it always prints.
Is it possible to do this from/with a ppbdepipeline property (not with the
ppreport class)?

Forgive my English, please...

Comments

  • edited April 2002
    One option is to simply set the visibility property of the detail band to
    False. You in the report's BeforePrint event, ie.

    if (aTable1.RecordCount = 1) then
    ppReport1.DetailBand.Visible := False
    else
    ppReport1.DetailBand.Visible := True;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited April 2002
    The problem is that I can't use the "ppreport" class, but the ppBDEpipeline,
    because I have a lot of ppreports linked to the same pipeline.

    I don't want to do this:

    ppreport1.ppReport1.DetailBand.Visible := False;
    ppreport2.ppReport1.DetailBand.Visible := False;
    ppreport3.ppReport1.DetailBand.Visible := False;
    ppreport4.ppReport1.DetailBand.Visible := False;
    .
    .
    .

    but this:
    ppbdepipeline.something


    Do you understand?




    "Alexander Kramnik (Digital Metaphors)"
  • edited April 2002
    That's not exactly what I meant. You write a single event handler such as:

    procedure TForm1.ppReportBeforePrint(Sender: TObject);
    begin
    if (aTable1.RecordCount = 1) then
    TppReport(Sender).DetailBand.Visible := False
    else
    TppReport(Sender).DetailBand.Visible := True;
    end;

    and assign this single event handler to all the reports.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.