Skip to content

DevExpress-Examples/reporting-winforms-create-table-at-runtime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reporting for WinForms - Create a Data-Bound Table at Runtime

This example contains code that creates a report with a data-bound table. You can create a table within a report in the following ways:

  • Create a new report instance and add bands/controls to it.
  • Call the method that creates a table in the BeforePrint event handler.
  • Create a table in the report constructor (call the method in the report's code-behind file).

A table in a report is the XRTable reporting control. You should add this control to the collection of controls for a specific report band. Populate the row collection, and add cells to the cell collection for each row. Enclose all row and cell collection modifications within the XRTable.BeginInit and XRTable.EndInit method pair.

Use the XRTableCell.ExpressionBindings property to bind a cell to a data field.

Explicitly specify the XRTable control width. When you add rows and cells to the table, their widths are adjusted to fit the table width.

Explicitly specify the table height only if you do not expect cell content to exceed the cell height. If the XRTableCell.CanGrow option is enabled, the cell can grow to display the entire content.

Data-bound table in a WinForms report

Files to Review

Documentation