Skip to content

Demonstrates how to dynamically create a report based on the GridControl visible rows.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-reporting-create-grid-based-report

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinForms Reporting - Convert the Grid control to a report

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.

Ribbon UI

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.

DataTable Method

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.

ReportGenerator Method

The ReportGenerator.GenerateReport method creates a report from the GridView and allows you to specify the report generation options.

Report preview with data from expanded rows in the GridControl

The example uses the SQLite database with Northwind data.

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Demonstrates how to dynamically create a report based on the GridControl visible rows.

Topics

Resources

License

Stars

Watchers

Forks