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

Creating Groups Dinamically

edited May 2003 in General

Hi, I'm using RBuilder with Delphi6, and I coudn't find out how to create
Groups in my report via code, dinamically, any tutorial or idea will help
me.


Thanks, Bruno M. Long

Comments

  • edited May 2003
    Hi Bruno,

    This, along with many other helpful articles, is located in the
    digital-metaphors.public.reportbuilder.tech-tips newsgroup.

    ----------------------------------------------------
    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
  • edited May 2003
    It Worked OK, Thanks.


This discussion has been closed.