Class MatrixHeaderDescriptor
The descriptor that is used to describe one element of the matrix header.
Implements
Inherited Members
Namespace: FastReport.Matrix
Assembly: FastReport.OpenSource.dll
Syntax
public class MatrixHeaderDescriptor : MatrixDescriptor, IFRSerializable
Remarks
The MatrixHeaderDescriptor class is used to define one header element of the matrix (either the column element or row element). The key properties are Expression, Sort and Totals.
To set visual appearance of the element, use the TemplateCell property. To set visual appearance of the "total" element, use the TemplateTotalCell property.
The collection of descriptors used to represent the matrix header is stored in the MatrixObject.Data.Columns and MatrixObject.Data.Rows properties.
Constructors
MatrixHeaderDescriptor()
Initializes a new instance of the MatrixHeaderDescriptor class with default settings.
Declaration
public MatrixHeaderDescriptor()
MatrixHeaderDescriptor(String)
Initializes a new instance of the MatrixHeaderDescriptor class with specified expression.
Declaration
public MatrixHeaderDescriptor(string expression)
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The descriptor's expression. |
MatrixHeaderDescriptor(String, SortOrder, Boolean)
Initializes a new instance of the MatrixHeaderDescriptor class with specified expression, sort order and totals.
Declaration
public MatrixHeaderDescriptor(string expression, SortOrder sort, bool totals)
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The descriptor's expression. |
SortOrder | sort | Sort order used to sort header values. |
System.Boolean | totals | Indicates whether to show the "total" element. |
MatrixHeaderDescriptor(String, Boolean)
Initializes a new instance of the MatrixHeaderDescriptor class with specified expression and totals.
Declaration
public MatrixHeaderDescriptor(string expression, bool totals)
Parameters
Type | Name | Description |
---|---|---|
System.String | expression | The descriptor's expression. |
System.Boolean | totals | Indicates whether to show the "total" element. |
Properties
PageBreak
Gets or sets a value indicating that the page break must be printed before this element.
Declaration
public bool PageBreak { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Page break is not printed before the very first element.
Sort
Gets or sets the sort order of header values.
Declaration
public SortOrder Sort { get; set; }
Property Value
Type | Description |
---|---|
SortOrder |
Remarks
This property determines how the values displayed in this element are sorted. The default sort is ascending.
SuppressTotals
Gets or sets a value that determines whether it is necessary to suppress totals if there is only one value in a group.
Declaration
public bool SuppressTotals { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
TemplateTotalCell
Gets or sets the template cell bound to the "total" element of this descriptor.
Declaration
public TableCell TemplateTotalCell { get; set; }
Property Value
Type | Description |
---|---|
TableCell |
Remarks
This property may be useful to change the "Total" text by something else.
note
Before using this property, you must initialize the matrix descriptors by calling the BuildTemplate() method.
Examples
This example shows how to change the "Total" element.
MatrixObject matrix;
matrix.Data.Rows[0].TemplateTotalCell.Text = "Grand Total";
matrix.Data.Rows[0].TemplateTotalCell.Fill = new SolidFill(Color.Green);
TemplateTotalColumn
Gets or sets the template column bound to the "total" element of this descriptor.
Declaration
public TableColumn TemplateTotalColumn { get; set; }
Property Value
Type | Description |
---|---|
TableColumn |
Remarks
This property is for internal use; usually you don't need to use it.
TemplateTotalRow
Gets or sets the template row bound to the "total" element of this descriptor.
Declaration
public TableRow TemplateTotalRow { get; set; }
Property Value
Type | Description |
---|---|
TableRow |
Remarks
This property is for internal use; usually you don't need to use it.
Totals
Gets or sets a value indicating that this element has associated "total" element.
Declaration
public bool Totals { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
To access the matrix cell that is bound to the "Total" element, use the TemplateTotalCell property. It may be useful to change the "Total" text by something else.
Examples
This example shows how to change the "Total" text of the total element.
MatrixObject matrix;
matrix.Data.Rows[0].TemplateTotalCell.Text = "Grand Total";
TotalsFirst
Gets or sets the value indicating whether the total values must be printed before the data.
Declaration
public bool TotalsFirst { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Assign(MatrixDescriptor)
Assigns values from another descriptor.
Declaration
public override void Assign(MatrixDescriptor source)
Parameters
Type | Name | Description |
---|---|---|
MatrixDescriptor | source | Descriptor to assign values from. |
Overrides
Serialize(FRWriter)
Serializes the object.
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer | Writer object. |