This example demonstrates how to dynamically create a DevExpress report based on the ASPxGridView control's data and layout. The resulting report maintains all sorting, grouping, and filtering settings applied to the grid. The example code exports this report to a PDF file, but you can also insert the resulting report into another report.
Follow the steps below to create a report based on the Grid View control's data:
- Create an instance of the XtraReport class.
- Bind the instance to the Grid View's data source.
- Based on the Grid layout, create bands and add them to the report.
- Create report controls and add them to the bands.
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
- ReportHelper.cs (VB: ReportHelper.vb)