Table Overview
- 2 minutes to read
The XRTable control displays information in a tabular format and allows you to create table reports.
You can add a table control by dragging the XRTable item from the toolbox DX.24.2.3: Report Controls tab onto the report’s area.
You can also create two tables simultaneously, for instance, one that shows column titles in the Page Header and one that shows regular information in the Detail band. Select the XRTable item in the Toolbox and draw a rectangle across these bands.
The XRTable control contains one or more rows (XRTableRow objects) stored in the XRTable.Rows collection. Each row contains one or more cells (XRTableCell objects) that you can access using the XRTableRow.Cells property. See the Report Explorer for a table structure example.
Use the XRControl.Text property to specify the cell’s static text. You can double-click the cell to invoke its in-place editor and type the desired text.
You can adjust the font size of a cell’s static text to fit into the cell’s boundaries by right-clicking this cell and selecting Fit Text to Bounds in the context menu.
Refer to Bind Table Cells to Data to learn about providing dynamic content to table cells.
A table cell is like an XRLabel control - it provides the same options for text formatting, alignment, appearance, interactivity, etc. See the Label topic for information on how to specify these options.
You can also use a table cell as a container for other report controls. To do that, drop a control from the toolbox onto this cell.
If a table cell includes only one control, you can right-click this control and use the Fit Bounds to Container command in the context menu. This command resizes the control so that it occupies all the available cell space (excluding borders).
To transform a table into a set of XRLabel controls, right-click a table or any of its cells and select Convert To Labels. Table cells containing other controls are converted to XRPanel controls.
You can assign different visual styles for even and odd table rows to improve readability.