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

Start new page after a subreport

edited September 2004 in General
I have a two subreports (ppSubReport1 and ppSubReport2) in the Title band of
the report. How can I start new page after first subreport?

I use next code, but it isn't work:

procedure TfmSettings.ppSubReport1Print(Sender: TObject);
begin
ppReport.Title.NewPage:=true;
end;

For unknown reason this code start new page after ppSubReport2...?

Tanks for any help.

Comments

  • edited September 2004
    Hi Shura,

    First try making your first subreport a Section style subreport. This will
    cause the subreport to always break a page after it has printed. If this
    does not give you the effect you are after, try using the
    TitleBand.OutOfSpace property. Always be sure you have the ShiftRelativeTo
    property set correctly for the second subreport.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited September 2004
    Thank you for the response.

    Here are bit more details:
    Both subreport uses JitPipeline.
    Report.PassSettings := TwoPass;
    SubReport2.ShiftRelativeTo:= SubReport1;

    On your advice I use next code:

    procedure TfmSettings.ppSubReport2DetailBandBeforeGenerate(Sender: TObject);
    begin
    ppReport.Title.OutOfSpace:=true;
    end;

    After this update program goes to the infinite loop. It seems that after
    setting ppReport.Title.OutOfSpace report start to regenerate SubReport1 and
    then fire event ppSubReport2DetailBandBeforeGenerate and so on.

    After setting SubReport1.PrintBehavior = pbSection program goes to the
    infinite loop too.


    If I comment this code, program work fine except starting a new page after
    SubReport1.

    I will appericate any help or ideas on this question.

    Regards,
    Shura

  • edited October 2004
    Hi Shura,

    I've spent a little bit of time with this one. One way you could get this
    effect would be to place two Section style subreports inside the detail band
    of your main report (this would be the only band in your main report with no
    pipeline connected). Then acting as the first subreport in you title band
    would be the first section subreport. Then the second subreport plus the
    rest of the report would go in the second section style subreport.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.