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

Determining wether subreport starts on page 1 or page 2

edited May 2002 in General
Hi,
I have a report with various subreport. The subreports contain memofields
that are filled on runtime and all shiftrelative to the previous memofields.
How can i determine wether subreport2 starts on page 1 or on page 2 during
generation of the report. Before generating, I do not know how long the
content of the different memos will be.

Hope someone can help

FYI
Delphi 4
RBuilder 6.03

Joost

Comments

  • edited May 2002
    When you place a subreport on you main report an associated TppChildReport
    object is also created. You can find it using the Object Inspector or the
    Report Tree. Place the following code in the StartFirstPass and EndFirstPass
    events of the child report object to keep track of on what pages each
    subreport begins.

    var
    uPrinting: Boolean; // initalized to False in the FormCreate

    procedure TForm1.ppChildReport1StartFirstPass(Sender: TObject);
    begin
    if not(FPrinting) then
    begin
    FPrinting := True;
    // report starts on page ppReport1.PageNo;
    // other code
    end;
    end;

    procedure TForm1.ppChildReport1EndFirstPass(Sender: TObject);
    begin
    FPrinting := False;
    // other code;
    end;

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.