Get Free Trial
API reference
Table of contents

SliceObject

Slice is a definition of what data subset from the data source is going to be shown in the report. Learn more in this tutorial with examples: Slice.

Change the slice using runQuery() and setReport() API calls. Get the slice among other report parts using getReport().

Available properties

The SliceObject has the following properties:

Property/Type Description
columns
FieldObject[]
A list of fields selected for columns.
drills
DrillsObject
optional Stores information about drilled-down multilevel hierarchies.
drillThrough
String[]
optional Allows pre-defining the slice for the drill-through view. The drillThrough can be specified like this: ["Field name 1", "Field name 2", etc.] (see live demo).
Only for "csv", "json", and "api" data source types.
expands
ExpandsObject
optional Stores information about expanded fields.
flatSort
FlatSortObject[]
optional Defines sorting for columns in the flat view. Only for "json", "csv", and "api" data source types.
Note Columns are sorted in the order they were specified (i.e., the first column is sorted first, and so on). Therefore, take the columns’ order into account when sorting multiple columns. See an example on JSFiddle.
To sort multiple columns via UI, press Ctrl and click a sorting arrow on each column to be sorted.
flatOrder
String[]
optional Defines the order of the fields for the "flat" grid type. flatOrder can be specified like this: ["Field name 1", "Field name 2", etc.] (see live demo).
Only for "json", "csv", and "api" data source types.
measures
MeasureObject[]
A list of the selected measures and those which have non-default properties.
memberProperties
MemberPropertyObject[]
optional Allows showing attribute hierarchies (also known as member properties) on the grid.
Only for the "microsoft analysis services" data source type.
reportFilters
FieldObject[]
optional A list of fields selected for report filters.
rows
FieldObject[]
A list of fields selected for rows.
sorting
SortingObject
optional Defines the sorting for numbers in a specific row and/or column in the pivot table.
To clear the sorting, use the sortValues API call.

FieldObject

Property/Type Description
uniqueName
String
The field’s unique name.
caption
String
optional The field’s caption.
dimensionName
String
optional The dimension name.
filter
FilterObject
optional Contains filtering information.
levelName
String
optional If the field is a multilevel hierarchy, the levelName allows setting a specific hierarchy level to be shown on the grid or chart (see live demo).
This property does not apply to report filters.
showTotals
Boolean
optional Defines whether totals are shown or hidden for the field. When set to true, totals are shown. Only for the classic view.
If showTotals is not specified, totals’ visibility is defined by the options.showTotals property.
To show and hide totals via UI, use the context menu. Open it by right-clicking the field header.
This property does not apply to report filters.
sort
String
optional The sorting type for members: "asc", "desc" or "unsorted".
sortOrder
String[]
optional Sets custom ordering for field members. The sortOrder can be specified like this: ["member_1", "member_2", etc.].
Only for "csv" and "json" data source types.

DrillsObject

Property/Type Description
drillAll
Boolean
optional Set this property to true to drill down all multilevel hierarchies. Works for the grid and the charts.
drillAllColumns
Boolean
optional Set this property to true to drill down all multilevel hierarchies in columns. Works for the grid and the charts.
drillAllRows
Boolean
optional Set this property to true to drill down all multilevel hierarchies in rows. Works for the grid and the charts.
columns
RecordIdentifierObject[]
optional Used to save and restore drilled-down columns.
rows
RecordIdentifierObject[]
optional Used to save and restore drilled-down rows.

ExpandsObject

Property/Type Description
expandAll
Boolean
optional Set this property to true to expand all fields. Works for the grid and the charts.
expandAllColumns
Boolean
optional Set this property to true to expand all fields in columns. Works for the grid and the charts.
expandAllRows
Boolean
optional Set this property to true to expand all fields in rows. Works for the grid and the charts.
columns
RecordIdentifierObject[]
optional Used to save and restore expanded columns.
rows
RecordIdentifierObject[]
optional Used to save and restore expanded rows.

RecordIdentifierObject

Property/Type Description
tuple
String[]
Consists of unique names that identify the row/column in the table based on the row’s/column’s data.

FlatSortObject

Property/Type Description
uniqueName
String
The unique name of the column being sorted.
sort
String
The sorting type: "asc", "desc", or "undefined".

MeasureObject

Property/Type Description
uniqueName
String
The measure’s unique name.
active
Boolean
optional Indicates whether the measure will be selected for the report (true) or not (false). active: false can be useful if the measure has non-default properties, but should not be selected for the grid or the chart.
aggregation
String
optional The name of the aggregation that will be applied to the measure. To see the list of supported aggregation functions for each data source type, refer to Flexmonster’s technical specifications.
If the measure is calculated, skip the aggregation property.
caption
String
optional The measure’s caption.
formula
String
optional Represents the formula. Refers to the calculated measure. It can contain:
  • Operators and functions. Check out the full list.
  • Numbers. Negative numbers can be used as well (see an example).
  • Measures. A measure can be addressed using its unique name and an aggregation function. For example, sum("Price") or max("Order"). See a list of supported aggregations in Flexmonster’s technical specifications.
  • Calculated measures. To address another calculated measure, specify its unique name. For example, "Formula #1".
individual
Boolean
optional Refers to the calculated measure. Defines whether the formula is calculated using raw values (true) or using aggregated values (false).
Only for "json" and "csv" data source types.
Default value: false.
calculateNaN
Boolean
optional Refers to the calculated measure. Defines whether the formula is calculated using NaN values (true) or using null values (false).
Default value: true.
format
String
optional The name of the number formatting that will be applied to the measure.
Measure values can be formatted according to the number formatting defined in the report. All available formats are stored in the formats array in the report.
More information about the number formatting part of the report can be found in the number formatting article.
grandTotalCaption
String
optional The measure’s grand total caption.

MemberPropertyObject

Property/Type Description
levelName
String
The hierarchy’s unique name.
properties
String[]
Represents the properties to be shown on the grid. Other available member properties can be accessed through the context menu.

SortingObject

Property/Type Description
column
ValueSortingObject
Defines the sorting for numbers in a specific column.
row
ValueSortingObject
Defines the sorting for numbers in a specific row.

ValueSortingObject

Property/Type Description
tuple
String[]
Consists of unique names that identify the row/column in the table based on the row’s/column’s data.
measure
Object
Identifies the measure on which sorting will be applied.
measure.uniqueName
String
The measure’s unique name.
measure.aggregation
String
optional The measure’s aggregation type.
If the measure is calculated, skip the aggregation or set it to "none".
type
String
The sorting type: "asc" or "desc".

See also

Slice guide
runQuery()
setReport()
getReport()