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

How to define a group programmatically (at run time)

edited September 2002 in General
Hello,

I have a report which I define and customize programmatically at run time,
and I would like to add a group in this same manner. Of course, adding a
group at design time is straightforward, but I'm not sure how to do it at
run time. For instance, I can create an instance of TppGroup, but how do I
tell it which field to break on? (The Fieldname property is apparently
read-only).

Thanks in advance for any suggestions you might have!

Jason

Comments

  • edited September 2002
    This should work for you:
    With TppGroup.Create(Nil) Do
    Begin
    BreakName := GrpFieldName; {The database field name on which to
    break...}
    BreakType := btDataField;
    KeepTogether := True;
    Report := MyReport; {The report}
    Name := 'MyTestGroup';
    DataPipeline := MyReport.DataPipeline; {The report's datapipeline...}
    End;

    The "BreakName" property is the fieldname on which the report will break.

    HTH,
    Vikram

This discussion has been closed.