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

Print each records on a new page

edited August 2003 in General
Hi !

My report has a TppDetailBand and a TppFooterBand only. On the
TppDetailBand, I have some elements and 3 TppSubReports.

Usually, when I will print this report, it will only have 1 record in the
database. Sometimes, there will be more records. With 1 record, everything
is fine, but what I want to do is when I print with many records, I want
each records to start on a new page.

Thanks !

Comments

  • edited August 2003
    Hello,

    Try creating a group around the datafield you want to start a new page on.
    Then in the group dialog, be sure to check the "Start New Page" option or
    set the TppGroup.NewPage property to True.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    How do we create a group ?


  • edited August 2003
    Hi,

    For future reference, we prefer that our customers use their real name when
    posting to a digital-metaphors newsgroup.

    Groups can be created manually or dynamically in code. To manually create a
    group, select the Report | Groups menu option in the Report Designer. The
    group dialog will pop up and you can create a group from there around any
    data or static field you want. For more information on manually creating
    groups, please see the ReportBuilder Developer's Guide.

    Groups can also be created in code...

    ----------------------------------------------------
    Tech Tip: Creating a Group in Code
    ----------------------------------------------------

    example code:
    -------------

    uses
    ppClass, ppGroup, ppClasUt;


    function AddGroupToReport(aBreakName: String; aDataPipeline:
    TppDataPipeline; aReport: TppCustomReport);
    var
    lGroup: TppGroup;
    lGroupBand: TppGroupBand;

    begin


    {add group to report}
    lGroup := TppGroup(ppComponentCreate(aReport, TppGroup));

    lGroup.Report := aReport;

    lGroup.BreakName := aBreakName;
    lGroup.DataPipeline := aDataPipeline;

    {add group header and footer bands }
    lGroupBand := TppGroupBand(ppComponentCreate(aReport,
    TppGroupHeaderBand));
    lGroupBand.Group := lGroup;

    lGroupBand := TppGroupBand(ppComponentCreate(aReport,
    TppGroupFooterBand));
    lGroupBand.Group := lGroup;


    end; {procedure, AddGroupToReport}

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited August 2003
    Hi again !

    I must be dumb but it dosen't work. I got my group. I put objects on it and
    set the "start new page" option ON. Why it dosen't start a new page when the
    group start each time !?

    Thanks for your patience !


  • edited August 2003
    Hi Alex,

    Take a look at Demo 16 in the \RBuilder\Demos\Reports\... directory.
    (dm0016.pas). This demo gives a good example of how a group is supposed to
    work. Also if you go into the groups dialog and set the Start New Page
    option, you will see that each group starts a new page. If you still have
    problems after seeing this, please send an example of your project to
    support@digital-metaphors.com in .zip format and I'll take a look at it for
    you.

    --
    Best Regards,

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