Serializes pivot table data to JSON string.
Inheritance Hierarchy
NReco.PivotData.OutputPivotTableJsonWriter
Namespace: NReco.PivotData.Output
Assembly: NReco.PivotData.Extensions (in NReco.PivotData.Extensions.dll) Version: 1.6.1
Syntax
The PivotTableJsonWriter type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| PivotTableJsonWriter | Initializes a new instance of the PivotTableJsonWriter class |
Properties
| Name | Description | |
|---|---|---|
| FormatDimensionLabel |
Gets or sets custom formatting handler for dimension labels (JSON: 'Columns' and 'Rows' arrays).
| |
| FormatKey |
Gets or sets custom formatting handler for table row/column labels (key,dimension)->(label).
| |
| FormatMeasureHeader |
Gets or sets custom formatting handler for measure headers (JSON: 'MeasureLabels' array).
| |
| FormatValue |
Gets or sets custom formatting handler for table cell values (measure,measure index)->(value)
| |
| IncludeTotals |
Get or sets flag which indicates whether writer should include pivot table values into JSON (true by default).
| |
| IncludeValues |
Get or sets flag which indicates whether writer should include pivot table values into JSON (true by default).
| |
| SubtotalColumns |
Include subtotal columns into resulting pivot table (false by default).
| |
| SubtotalRows |
Include subtotal rows into resulting pivot table (false by default).
|
Methods
| Name | Description | |
|---|---|---|
| Equals | (Inherited from Object.) | |
| Finalize | (Inherited from Object.) | |
| GetHashCode | (Inherited from Object.) | |
| GetType | (Inherited from Object.) | |
| MemberwiseClone | (Inherited from Object.) | |
| ToString | (Inherited from Object.) | |
| Write |
Serializes pivot table to JSON string.
|
Remarks
{
Columns : ["C1", "C2"], // column dimensions
ColumnKeys : [ ["C1_val1", "C1_val2"], [ "C2_val" ] ], // array of dimension keys for each column
Rows : ["R1"], // row dimensions
RowKeys : [ ["R1_val1", "R1_val2", "R3_val3"] ], // array of dimension keys for each row
Values : [ // array of rows, each row is array of column values
[ row_0_col0_value, row_0_col1_value],
[ row_1_col0_value, row_1_col1_value],
[ row_2_col0_value, row_2_col1_value]
],
GrandTotal : total_value, // depends on cube measures configuration
ColumnTotals : [ col_0_subtotal_value, col_1_subtotal_value ], // array of values for column sub-totals
RowTotals : [ row_0_subtotal_value, row_1_subtotal_value, row_2_subtotal_value ], // array of values for row sub-totals
MeasureLabels : ["Count", "Sum of amount"] // array of measure names
}GrandTotal : [70 /* count */, 564.4 /* sum of amount */ ]
See Also