# Create Sections Programmatically

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:

```C#
Telerik.Reporting.DetailSection detail = new Telerik.Reporting.DetailSection();
detail.Height = new Telerik.Reporting.Drawing.Unit(3.0, Telerik.Reporting.Drawing.UnitType.Inch);
detail.Name = "detail";
report.Items.Add((Telerik.Reporting.ReportItemBase)detail);
```

```VB.NET
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"
MyReport.Items.Add(DirectCast(detail, Telerik.Reporting.ReportItemBase))
```

## See Also

* [ReportHeaderSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.reportheadersection)
* [ReportFooterSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.reportfootersection)
* [DetailSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.detailsection)
* [GroupHeaderSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.groupheadersection)
* [GroupFooterSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.groupfootersection)
* [PageHeaderSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.pageheadersection)
* [PageFooterSection](https://www.telerik.com/products/reporting/documentation/api/telerik.reporting.pagefootersection)
