XRTableRow.Weight Property
Gets or sets the relative size of the XRTableRow in respect to the sizes of other rows in a table.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v18.2.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
Double | 0 | Specifies the row’s size in relation to other rows. |
Remarks
When creating large tables in code, you can increase the report generator performance by setting the Weight property to 1 for all table rows.
Example
If you create all table rows and cells manually, like in the code sample below, you may run into report performance issues. Set the XRTableRow.Weight
and XRTableCell.Weight properties to 1 for all table rows and cells, respectively, to improve the performance.
Note
We do not recommend this approach. Use the approach described in the Create a Table at Runtime section.
using DevExpress.XtraReports.UI;
// ...
private XRTable CreateLargeTable(int rowCount, int cellCount) {
XRTable table = new XRTable();
table.BeginInit();
for (int i = 0; i < rowCount; i++) {
XRTableRow row = new XRTableRow() {
// Set the row's Weight property to improve the performance.
Weight = 1
};
for (int j = 0; j < cellCount; j++) {
XRTableCell cell = new XRTableCell() {
// Set the cell's Weight property to improve the performance.
Weight = 1
};
row.Cells.Add(cell);
}
table.Rows.Add(row);
}
table.EndInit();
return table;
}
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the Weight property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.