Get Free Trial
  1. API reference
    1. Introduction
    2. Flexmonster()
  2. Objects
    1. All objects
    2. Report Object
    3. Data Source Object
    4. Mapping Object
    5. Slice Object
    6. Options Object
    7. Global Object
    8. Filtering
      1. Filter Object
      2. Number Query Object
      3. String Query Object
      4. Date Query Object
      5. Time Query Object
      6. Value Query Object
    9. Format Object
    10. Conditional Format Object
    11. Table Sizes Object
    12. Cell Data Object
    13. Chart Data Object
    14. Toolbar Object
    15. Chart Legend Data Object
    16. Share Report Connection Object
  3. Methods
    1. All methods
    2. addCalculatedMeasure
    3. addCondition
    4. alert
    5. clear
    6. clearFilter
    7. clearXMLACache
    8. closeFieldsList
    9. collapseAllData
    10. collapseCell
    11. collapseData
    12. connectTo
    13. customizeAPIRequest
    14. customizeCell
    15. customizeChartElement
    16. customizeContextMenu
    17. dispose
    18. drillDownCell
    19. drillUpCell
    20. expandAllData
    21. expandCell
    22. expandData
    23. exportTo
    24. getAllConditions
    25. getAllHierarchies
    26. getAllHierarchiesAsync
    27. getAllMeasures
    28. getAllMeasuresAsync
    29. getCell
    30. getColumns
    31. getColumnsAsync
    32. getCondition
    33. getFilter
    34. getFlatSort
    35. getFormat
    36. getMeasures
    37. getMeasuresAsync
    38. getMembers
    39. getMembersAsync
    40. getOptions
    41. getReport
    42. getReportFilters
    43. getReportFiltersAsync
    44. getRows
    45. getRowsAsync
    46. getSelectedCell
    47. getSort
    48. getTableSizes
    49. getXMLACatalogs
    50. getXMLACatalogsAsync
    51. getXMLACubes
    52. getXMLACubesAsync
    53. getXMLADataSources
    54. getXMLADataSourcesAsync
    55. getXMLAProviderName
    56. getXMLAProviderNameAsync
    57. load
    58. off
    59. on
    60. open
    61. openCalculatedValueEditor
    62. openFieldsList
    63. openFilter
    64. print
    65. refresh
    66. removeAllCalculatedMeasures
    67. removeAllConditions
    68. removeCalculatedMeasure
    69. removeCondition
    70. removeSelection
    71. runQuery
    72. save
    73. scrollToColumn
    74. scrollToRow
    75. setFilter
    76. setFlatSort
    77. setFormat
    78. setOptions
    79. setReport
    80. setSort
    81. setTableSizes
    82. shareReport
    83. showCharts
    84. showGrid
    85. showGridAndCharts
    86. sortingMethod
    87. sortValues
    88. updateData
  4. Events
    1. All events
    2. afterchartdraw
    3. aftergriddraw
    4. beforegriddraw
    5. beforetoolbarcreated
    6. cellclick
    7. celldoubleclick
    8. chartclick
    9. datachanged
    10. dataerror
    11. datafilecancelled
    12. dataloaded
    13. drillthroughclose
    14. drillthroughopen
    15. exportcomplete
    16. exportstart
    17. fieldslistclose
    18. fieldslistopen
    19. filterclose
    20. filteropen
    21. loadingdata
    22. loadinglocalization
    23. loadingolapstructure
    24. loadingreportfile
    25. localizationerror
    26. localizationloaded
    27. olapstructureerror
    28. olapstructureloaded
    29. openingreportfile
    30. printcomplete
    31. printstart
    32. querycomplete
    33. queryerror
    34. ready
    35. reportchange
    36. reportcomplete
    37. reportfilecancelled
    38. reportfileerror
    39. runningquery
    40. unauthorizederror
    41. update
  5. Custom data source API
    1. All requests
    2. /handshake request
    3. /fields request
    4. /members request
    5. /select request for the pivot table
    6. /select request for the flat table
    7. /select request for the drill-through view
    8. Field Object
    9. Filter Object
    10. Filter Group Object
  6. MongoDB Connector API
    1. All methods
    2. getSchema
    3. getMembers
    4. getSelectResult
  7. Flexmonster Connector for amCharts
    1. All methods
    2. amcharts.getData
    3. amcharts.getCategoryName
    4. amcharts.getMeasureNameByIndex
    5. amcharts.getNumberOfMeasures
    6. amcharts.getNumberFormatPattern
Table of contents

Slice Object

Slice is a definition of what data subset from the data source is going to be shown in the report. This object has the following properties:

  • columns – Array of objects. A list of hierarchies selected in the report slice for columns. Each object can have the following properties:
    • uniqueName – String. A hierarchy unique name.
    • caption (optional) – String. A hierarchy caption.
    • dimensionName (optional) – String. A dimension name.
    • filter (optional) – Filter Object. It contains filtering information.
    • levelName (optional) – String. It used to specify the level of the hierarchy that is shown on the grid.
    • showTotals (optional) — Boolean. Defines whether totals are shown or hidden for the hierarchy. 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. Learn more about options.showTotals.
      To show and hide totals via UI, use a context menu. Open it by right-clicking the hierarchy header.
    • sort (optional) – String. A sorting type for the members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array. Using this property you can set custom sorting for hierarchy members. You can specify sortOrder the following way: ["member_1", "member_2", etc.]. Only for "csv" and "json" data source types.
  • drills (optional) – Object. Stores the information about drill-downs in multilevel hierarchies:
    • drillAll (optional) – Boolean. It indicates whether all levels of all hierarchies in slice will be drilled down (true) or drilled up (false).
    • columns (optional) – Array of objects. It is used to save and restore drilled down columns.
    • rows (optional) – Array of objects. It is used to save and restore drilled down rows.
  • drillThrough (optional) – Array. It allows pre-defining slice for the drill-through view. Only for "csv", "json", and "api" data source types. Can be specified the following way: ["Hierarchy name 1", "Hierarchy name 2", etc.] (see live demo).
  • expands (optional) – Object. Stores the information about expanded nodes:
    • expandAll (optional) – Boolean. Indicates whether all nodes in the data tree will be expanded (true) or collapsed (false) on the grid and on charts.
    • columns (optional) – Array of objects. It is used to save and restore expanded columns.
    • rows – Array of objects. It is used to save and restore expanded rows.
  • flatSort – Array of objects. Defines sorting for columns in the flat view. Only for "json", "csv", and "api" data source types.
    Each object in the array has the following properties:
    • uniqueName – String. The unique name of the column being sorted.
    • sort – String. The sorting type ("asc", "desc", or "undefined").
    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.
  • measures – Array of objects. A list of selected measures and those which have different properties from default ones. Each object has the following properties:
    • uniqueName – String. A measure unique name.
    • active (optional) – Boolean. A value that defines whether the measure will be in the list of available values but not selected (false) or will be selected for the report (true).
    • aggregation (optional) — String. A unique name of 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 it is a calculated measure, it will be "none".
    • availableAggregations (optional) — Array of strings. Note that starting from version 2.8, the availableAggregations property is considered deprecated. Use the Mapping object’s aggregations property instead.
      availableAggregations represents the list of aggregation functions which can be applied to the current measure. If it is a calculated measure, it will be [].
    • caption (optional) – String. A measure caption.
    • formula (optional) – String. Represents the formula. Refers to the calculated measure. It can contain the following operators: +, -, *, / (check a full list). Other measures can be referenced using the measure’s unique name and the associated aggregation function, for example sum("Price") or max("Order"). To see the list of supported aggregation functions for each data source type, refer to Flexmonster’s technical specifications.
    • individual (optional) – Boolean. It 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 (optional) – Boolean. Defines whether the formula is calculated using the NaN values (true) or using the null values (false). Default value: true.
    • format (optional) – String. A name of number formatting.
    • grandTotalCaption (optional) – String. A measure grand total caption.
  • flatOrder – Array of strings. Defines the order of the hierarchies for the "flat" grid type. flatOrder can be specified like this: ["Hierarchy name 1", "Hierarchy name 2", etc.] (see live demo). Only for "json", "csv", and "api" data source types.
  • memberProperties – Array of objects. Only for "microsoft analysis services" and "mondrian" data source types. Each object in the array has the following properties:
    • levelName – String. A hierarchy unique name.
    • properties – Array. It contains member properties, which will be shown on the grid. Other available member properties can be accessed through the context menu.
  • reportFilters – Array of objects. A list of hierarchies selected in the report slice for report filters. Each object has the following properties:
    • uniqueName – String. A hierarchy unique name.
    • caption (optional) – String. A hierarchy caption.
    • dimensionName (optional) – String. A dimension name.
    • filter (optional) – Filter Object. It contains filtering information.
    • levelName (optional) – String. Used to specify the level of the hierarchy that is shown on the grid.
    • sort (optional) – String. A sorting type for the members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array. Using this property you can set custom sorting for hierarchy members. Only for "csv" and "json" data source types. You can specify sortOrder the following way: ["member_1", "member_2", etc.].
  • rows – Array of objects. A list of hierarchies selected in the report slice for rows. Each object can have the following properties:
    • uniqueName – String. A hierarchy unique name.
    • caption (optional) – String. A hierarchy caption.
    • dimensionName (optional) – String. A dimension name.
    • filter (optional) – Filter Object. It contains filtering information.
    • levelName (optional) – String. Used to specify the level of the hierarchy that is shown on the grid.
    • showTotals (optional) — Boolean. Defines whether totals are shown or hidden for the hierarchy. 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. Learn more about options.showTotals.
      To show and hide totals via UI, use a context menu. Open it by right-clicking the hierarchy header.
    • sort (optional) – String. A sorting type for the members ("asc", "desc" or "unsorted").
    • sortOrder (optional) – Array. Using this property you can set custom sorting for hierarchy members. Only for "csv" and "json" data source types. You can specify sortOrder the following way: ["member_1", "member_2", etc.].
  • sorting (optional) – Object. 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.
    The sorting object has the following properties:
    • column – Object. Defines the sorting for numbers in a specific column. The object has the following properties:
      • tuple – Array of strings. Consists of unique names that identify the column in the table based on the column’s data.
      • measure – Object. Identifies the measure on which sorting will be applied. Has the following properties:
        • uniqueName – String. The measure’s unique name.
        • aggregation (optional) – String. The measure’s aggregation type.
      • type – String. The sorting type ("asc" or "desc").
    • row – Object. Defines the sorting for numbers in a specific row. The object has the following properties:
      • tuple – Array of strings. Consists of unique names that identify the row in the table based on the row’s data.
      • measure – Object. Identifies the measure on which sorting will be applied. Has the following properties:
        • uniqueName – String. The measure’s unique name.
        • aggregation (optional) – String. The measure’s aggregation type.
      • type – String. The sorting type ("asc" or "desc").

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

Find more details about Slice Object in this tutorial with examples.