ReportDesign.sectionGroup Method
Finds a reportSectionGroup object below a reportDesign object.
Syntax
public ReportSectionGroup sectionGroup(TableId tableId, [FieldId fieldId])
Run On
Called
Parameters
- tableId
Type: TableId Extended Data Type
The table of the section group.
- fieldId
Type: FieldId Extended Data Type
The field of the section group; optional.
Return Value
Type: ReportSectionGroup Class
The section group that matches the arguments.
Examples
The following example finds the section group that is created by the addSection method:
static void test(args a)
{
reportRun rr;
inventTrans rec;
int i;
int t = tablenum(inventTrans);
int f = fieldnum(inventTrans, datePhysical);
// Create a simple report that is not present in
// the Application Object Tree.
report r = new report();
reportDesign rd = r.addDesign("myDesign");
reportSectionGroup rsg;
reportSection rs = rd.AddSection(reportBlockType::body, t);
rs.addControl(t,f);
rsg = rd.SectionGroup(t);
if (rsg)
{
rs = rsg.AddSection(ReportBlockType::Header);
rs.AddTextControl("This is the groupHeader");
}
// Run the report.
rr = new reportRun(r);
// Run the sysPrintForm form
if (rr.prompt())
{
select rec;
rr.send(rec);
// Print the report to the target, such as printer or screen, that
// was selected during the prompt call above.
rr.print();
}
}