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

making groups in a report

edited July 2005 in General
hi everyone..
I need to make a group in a report but It must make according to one or more
than one field that user chooses....That's to say I need to make group in
runttime...if someone can help me ...I would appreciate you...

Comments

  • edited July 2005
    Hi Ronhald,

    ----------------------------------------------------
    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}


    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Tranks Nico, If I've already created ppgroupheaderband in I want to change
    the field that lets to group PPreport, How can I Assign this value? Maybe It
    's setting something
    like.....ppgroupheaderband.groupband.breakname....please help me

  • edited July 2005
    Hi Ronhald,

    If you want to access groups that have already been created, you will want
    to use the TppReport.Groups property. Once you have the group you want to
    change, simply use the TppGroup.BreakName property to change the field it
    will break on. Where are you trying to make these changes. Be sure you do
    so before the report begins generating.

    --
    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.