title | page_title | description | slug | tags | published | position | previous_url |
---|---|---|---|---|---|---|---|
Create Sections |
Creating Sections with code |
Create Telerik Reporting sections programmatically, by instantiating the appropriate object, setting its properties, and adding it to the Report object's Items. |
telerikreporting/using-reports-in-applications/program-the-report-definition/create-sections-programmatically |
create, sections, programmatically, code |
true |
2 |
/programmatic-creating-sections |
To create sections in code, instantiate the appropriate object, set its properties, and add it to the Report object's Items collection. The objects you will need to work with are:
- DetailSection - for a detail section
- GroupHeaderSection - for a group header
- GroupFooterSection - for a group footer
- PageHeaderSection - for a page header
- PageFooterSection - for a page footer
- ReportHeaderSection - for a report header
- ReportFooterSection - for a report footer
For example, this code creates a detail section and adds it to the report:
Telerik.Reporting.DetailSection detail = new Telerik.Reporting.DetailSection();
this.detail.Height = new Telerik.Reporting.Drawing.Unit(3.0, Telerik.Reporting.Drawing.UnitType.Inch);
this.detail.Name = "detail";
report.Items.Add((Telerik.Reporting.ReportItemBase)detail);
Dim detail As New Telerik.Reporting.DetailSection()
Me.detail.Height = New Telerik.Reporting.Drawing.Unit(3, Telerik.Reporting.Drawing.UnitType.Inch)
Me.detail.Name = "detail";
report.Items.Add(DirectCast(detail, Telerik.Reporting.ReportItemBase))