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

When can use funtion 'TppCustomReport.AddGroup'?

edited April 2004 in General
Before report generate,
I want to add a group in the report depend on user's preference.
But the help file for TppCustomReport.AddGroup states "Do not call this
method." .
So how can I to do so??

TIA!

Comments

  • edited April 2004
    Hello,

    There is no need to call this method. Once you have created your group in
    code, you will need to assign the TppGroup.Report property to the current
    report. Once you do this, the group will be added to the defined report
    without the need to call AddGroup.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited April 2004
    Thanks, Nico.
    Would you mind giving me how to create group in code rather than in
    designer??
  • edited April 2004
    Hello,

    Hope this helps.

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


    How can I dynamically create a report group at run-time?


    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
This discussion has been closed.