This example demonstrates two techniques (methods) that allow you to do the following:
- Create a grid-based report in code.
- Preview the report at runtime.
- Load the report in the Report Designer.
The Ribbon UI includes the following options:
- DataTable Conversion - Demonstrates how to use the intermediate DataTable.
- Report Generator Conversion - Uses the
ReportGenerator
class from the Reporting Extensions library that ships as part of the DevExpress installation.
The GridView.GetVisibleRowHandle method is used to obtain visible data rows. A DataTable is created and passed to the report constructor in the code-behind file. The report constructor uses the GridView
to create a report layout at runtime. The XRTable structure is composed of grid column captions. Grouped columns generate the GroupHeaderBand in the report.
The ReportGenerator.GenerateReport method creates a report from the GridView and allows you to specify the report generation options.
The example uses the SQLite database with Northwind data.
- Form1.cs (VB: Form1.vb)
- XtraReport1.cs (VB: XtraReport1.vb)
- Convert DevExpress Data Grid to Report
- Advanced Grid Printing and Exporting
- Generate a Grid-Based Report (WPF)
(you will be redirected to DevExpress.com to submit your response)