Menu
Free Trials
  1. API reference
    1. flexmonster
    2. Report Object
    3. Options Object
    4. Format Object
  2. Methods
    1. addCalculatedMeasure
    2. addCondition
    3. addJSON
    4. addMeasure
    5. addStyleToMember
    6. addUrlToMember
    7. clear
    8. clearFilter
    9. clearXMLACache
    10. closeFieldsList
    11. collapseAllData
    12. collapseData
    13. connectTo
    14. dispose
    15. embedPivotComponent
    16. expandAllData
    17. expandData
    18. exportTo
    19. fullScreen
    20. getAllConditions
    21. getAllHierarchies
    22. getAllMeasures
    23. getCell
    24. getColumns
    25. getColumnWidth
    26. getCondition
    27. getData
    28. getFilter
    29. getFilterProperties
    30. getFormat
    31. getLabels
    32. getMeasures
    33. getMembers
    34. getOptions
    35. getPages
    36. getReport
    37. getRowHeight
    38. getRows
    39. getSelectedCell
    40. getSort
    41. getValue
    42. getXMLACatalogs
    43. getXMLACubes
    44. getXMLADataSources
    45. getXMLAProviderName
    46. gridColumnCount
    47. gridRowCount
    48. load
    49. off
    50. on
    51. open
    52. openFieldsList
    53. percentZoom
    54. print
    55. refresh
    56. removeAllCalculatedMeasures
    57. removeAllConditions
    58. removeAllMeasures
    59. removeCalculatedMeasure
    60. removeCondition
    61. removeMeasure
    62. removeSelection
    63. runQuery
    64. save
    65. setBottomX
    66. setChartTitle
    67. setColumnWidth
    68. setFilter
    69. setFormat
    70. setGridTitle
    71. setHandler
    72. setLabels
    73. setOptions
    74. setReport
    75. setRowHeight
    76. setSelectedCell
    77. setSort
    78. setStyle
    79. setTopX
    80. showCharts
    81. showGrid
    82. showGridAndCharts
    83. sortValues
    84. updateData
    85. zoomTo
    86. jsCellClickHandler
    87. jsFilterOpenHandler
    88. jsFieldsListCloseHandler
    89. jsFieldsListOpenHandler
    90. jsFullScreenHandler
    91. jsPivotCreationCompleteHandler
    92. jsPivotUpdateHandler
    93. jsReportChangeHandler
    94. jsReportLoadedHandler
  3. Events
    1. cellclick
    2. celldoubleclick
    3. dataerror
    4. datafilecancelled
    5. dataloaded
    6. exportcomplete
    7. exportstart
    8. fieldslistclose
    9. fieldslistopen
    10. filteropen
    11. loadingdata
    12. loadinglocalization
    13. loadingolapstructure
    14. loadingreportfile
    15. localizationerror
    16. localizationloaded
    17. olapstructureerror
    18. olapstructureloaded
    19. openingreportfile
    20. printcomplete
    21. printstart
    22. querycomplete
    23. queryerror
    24. ready
    25. reportchange
    26. reportcomplete
    27. reportfilecancelled
    28. reportfileerror
    29. reportfileloaded
    30. runningquery
    31. update
Table of contents

Report Object

Report object has the following properties:

  • dataSource – Object. Contains information about data source:
    • browseForFile – Boolean. Defines whether you want to load CSV file from the local file system (true) or not (false). Default value is false. Only for CSV and JSON data source type.
    • catalog – String. The data source catalog name of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • cube – String. Given catalog’s cube’s name of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • data (starting from v2.2) – Property to set JSON data if it is already on the page. See example in addJSON().
    • dataSourceInfo – String. The service info of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • dataSourceType – String. Type of data source. The component supports the following types: "microsoft analysis services", "mondrian", "iccube", "csv", "ocsv" and "json".
    • fieldSeparator – String. Defines specific fields separator to split CSV row (only for CSV data source type). There is no need to define it if CSV fields are separated by , or ;. This property is used if another char separates fields. For example, if you use TSV, where tab char is used to separate fields in row, fieldSeparator parameter should be defined as "\t".
    • filename – String. The URL to CSV or JSON file or to server-side script which generates CSV data or JSON data (only for CSV and JSON data source type).
    • ignoreQuotedLineBreaks (starting from v2.1) – Boolean. Indicates whether the line breaks in quotes will be ignored (true) in CSV files or not (false). Default value is true, which makes CSV parsing faster. Set it to false only if your data source has valuable for you line breaks in quotes. Please note that this might slow down CSV parsing a little bit.
    • proxyUrl – String. The path to proxy URL to the OLAP data source, such as Microsoft Analysis Services, Mondrian, icCube (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • recordsetDelimiter – String. Defines which char is used in CSV to denote the end of CSV row (only for CSV data source type). Default value is "↵".
    • subquery – String. The parameter to set the server-side filter which helps to decrease the size of the response from the OLAP cube (only for "microsoft analysis services" and "iccube" data source types). For example, to show reports only for one specific year set subquery the following way: "subquery": "select {[Delivery Date].[Calendar].[Calendar Year].&[2008]} on columns from [Adventure Works]".
  • slice – Object. Contains information about slice:
    • columns – Array of objects. A list of hierarchies selected in the report slice for columns. Each object has the following properties:
      • caption – String, hierarchy caption;
      • dimensionName – String, dimension name;
      • filter – object with the information on filtering:
        • members – Array of hierarchy’s members to be reflected/shown according to the applied filter;
        • negation – Boolean. Represents the filter on hierarchy’s members. It tells the component to show the members of hierarchy specified in items (true) or to show all the members of hierarchy except the items (false); (This property has been added in version 1.7)
        • measure – Represents the filter on values. The name of the measure on which Top X or Bottom X filter will be applied.
        • quantity – Represents the filter on values. Number of elements to choose for the Top X filter if type is 'top' or for the Bottom X filter if type is 'bottom'.
        • type – Represents the filter type applied to the hierarchy. It can be: 'none' – filter is not applied to the hierarchy, 'members' – the filter on hierarchy’s members is applied, 'top' – the filter Top X is applied on values, 'bottom' – the filter Bottom X is applied on values.
      • levelName – String. Used to specify the level of the hierarchy that is shown on the grid.
      • sort – String, 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.].
      • uniqueName – String, hierarchy unique name.
    • drills – Object.
      • drillAll (starting from v2.1) – Boolean. Indicates whether all levels of all hierarchies in slice will be drilled down (true) or drilled up (false).
      • columns – Array of objects. It is used to save and restore drilled down columns.
      • rows – Array of objects. It is used to save and restore drilled down rows.
    • expands – Object.
      • expandAll – Boolean. Indicates whether all nodes in the data tree will be expanded (true) or collapsed (false) on the grid and on charts.
      • columns – 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.
    • 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, measure unique name.
      • active (optional) – Boolean 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, unique name of aggregation that will be applied to the measure ("sum", "count", "distinctcount", "average", "product", "min", "max", "percent", "percentofcolumn", "percentofrow", "index"). If it is calculated measure, it will be "none".
      • availableAggregations (optional) — Array of strings that represents the list of aggregation functions which can be applied to the current measure. If it is calculated measure, it will be [].
      • caption (optional) – String, measure caption.
      • formula (optional) – String that represents the formula that can contain the following operations: +, -, *, /; other measures can be addressed using measure unique name and aggregation function, for example sum("Price") or max("Order"). Pivot supports the following aggregation functions for CSV data source: "sum", "count", "distinctcount", "average", "product", "min", "max", "percent", "percentofcolumn", "percentofrow", "index".
      • format (optional) – String, name of number formatting.
      • grandTotalCaption (optional) – String, measure grand total caption.
    • pages – Array of objects. A list of hierarchies selected in the report slice for pages (“Report Filter”). Each object has the following properties:
      • caption – String, hierarchy caption;
      • dimensionName – String, dimension name;
      • filter – object with the information on filtering:
        • members – Array of hierarchy’s members to be reflected/shown according to the applied filter;
        • negation – Boolean. It tells the component to show the members of hierarchy specified in items (true) or to show all the members of hierarchy except the items (false); (This property has been added in version 1.7)
      • levelName – String. Used to specify the level of the hierarchy that is shown on the grid.
      • sort – String. 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.].
      • uniqueName – String. Hierarchy unique name.
    • rows – Array of objects. A list of hierarchies selected in the report slice for rows. Each object has the following properties:
      • caption – String, hierarchy caption;
      • dimensionName – String, dimension name;
      • filter – object with the information on filtering:
        • members – Array of hierarchy’s members to be reflected/shown according to the applied filter;
        • negation – Boolean. Represents the filter on hierarchy’s members. It tells the component to show the members of hierarchy specified in items (true) or to show all the members of hierarchy except the items (false); (This property has been added in version 1.7)
        • measure – Represents the filter on values. The name of the measure on which Top X or Bottom X filter will be applied.
        • quantity – Represents the filter on values. Number of elements to choose for the Top X filter if type is 'top' or for the Bottom X filter if type is 'bottom'.
        • type – Represents the filter type applied to the hierarchy. It can be: 'none' – filter is not applied to the hierarchy, 'members' – the filter on hierarchy’s members is applied, 'top' – the filter Top X is applied on values, 'bottom' – the filter Bottom X is applied on values.
      • levelName – String. Used to specify the level of the hierarchy that is shown on the grid.
      • sort – String, 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.].
      • uniqueName – String, hierarchy unique name.
    • sorting – Object. Defines the sorting for numbers in a specific row and/or column in the pivot table.
      • column – Object. Defines the sorting for numbers in a specific column. Object has 3 properties:
        • tuple – Array. Consists of unique names that identifies the column in the table based on data in it;
        • measure – String. Measure unique name on which sorting will be applied;
        • type – String, sorting type ("asc" or "desc").
      • row – Object. Defines the sorting for numbers in a specific row. Object has 3 properties:
        • tuple – Array. Consists of unique names that identifies the row in the table based on data in it;
        • measure – String. Measure unique name on which sorting will be applied;
        • type – String, sorting type ("asc" or "desc").
    • useOlapFormatting (starting from version 2.1) – Boolean. It works for MSAS data source (XMLA and Accelerator) and for Mondrian (only Accelerator). Indicates whether the values from data source will be formatted according to the format defined in the cube (true) or not (false). Default value is false. useOlapFormatting is saved in the report JSON only if it is true.
  • options – Object. Contains information about options:
    • chart – Object. Contains information about charts:
      • activeMeasure – String. Selected measure on charts view.
      • activeTupleIndex – Number. Selected tuple index on the Pie chart.
      • autoRange – Boolean. Indicates whether the range of values on the charts is selected automatically or not.
      • multipleMeasures – Boolean. Starting from v1.9. Indicates whether to show multiple measures on charts. Default value is false.
      • oneLevel (starting from v2.1) – Boolean. In case of drillable chart, defines whether chart shows elements only for the lowest hierarchy (true). Default value is false. Bar, Line, Scatter, Bar stack and Bar line charts support this feature.
      • showFilter (starting from v2.2) – Boolean. Indicates whether the opening columns and rows filter controls are visible (true) or not (false) on the charts. Default value is true.
      • showLegendButton (starting from v2.2) – Boolean. Indicates whether the button to show/hide the legend on charts is visible. Default value is false which means that the legend is always visible, without the button that hides it.
      • showMeasures (starting from v2.2) – Boolean. Hides all dropdowns on the top of charts if you want to show simple chart without controls or you want to save space. Default value is true – the dropdowns are visible by default, as it was in previous versions.
      • showWarning – Boolean. Indicates whether the warning are shown if data is too big for charts.
      • title – String. Title of the chart.
      • type – String. Selected chart type. The following chart types are supported: "bar", "line", "scatter", "pie", "bar_stack" and "bar_line" (starting from v1.9).
    • configuratorActive – Boolean. Indicates whether the Fields List is opened (true) or closed (false).
    • configuratorButton – Boolean. Indicates whether the Fields List toggle button is visible (true) or not (false).
    • configuratorMatchHeight (starting from v2.1) – Boolean. Indicates whether the Fields List will be the same height as the component (true) or it’s height will be defined by its content amount (false). Default value is false.
    • datePattern – String. It is used to format “date string” date fields ("type":"date string" in JSON, "ds+" prefix in CSV). A default pattern string is dd/MM/yyyy.
    • dateTimePattern – String. It is used to format “datetime” date fields ("type":"datetime" in JSON, "dt+" prefix in CSV). A default pattern string is dd/MM/yyyy HH:mm:ss.
    • defaultHierarchySortName (starting from v2.0) – String. Sorting type for hierarchies’ members ("asc", "desc" or "unsorted"). Default value is "asc".
    • drillThrough (starting from v2.1) – Boolean. Indicates whether the drill through feature is enabled (true) or disabled (false). User can drill through by double-clicking the cell with value. This feature is available for CSV data sources only. Default value is true.
    • editing (starting from v2.1) – Boolean. Indicates whether the editing feature is enabled (true) or disabled (false) on the Drill Through popup for CSV and JSON data sources. User will be able to double-click the cell and enter new value in it if the editing feature is enabled.
    • grid – Object. Contains information about grid:
      • fitGridlines – Boolean. Indicates whether the gridlines are shown for all cells (false) or only non-empty (true).
      • pagesFilterLayout (starting from v2.3) – String. Allows to choose the layout for the report filters. Possible values: "horizontal" and "vertical". Default value is "horizontal".
      • showFilter – Boolean. Indicates whether the opening columns/rows filter controls and page filter controls are visible (true) or not (false) on the grid. Default value is true.
      • showGrandTotals – String. Specifies how to show grand totals: in rows ("rows"), in columns ("columns"), in rows and columns ("on") or hide them ("off"). Default value is "on".
      • showHeaders – Boolean. Indicates whether the spreadsheet headers are visible (true) or not (false).
      • showHierarchies – Boolean. Specifies how to show drillable hierarchy cells on the grid: with link on the right (true) or with icon on the left (false). Default value is true.
      • showHierarchyCaptions – Boolean. Indicates whether the hierarchy captions are visible (true) or not (false) on the grid. Default value is true.
      • showReportFiltersArea (starting from v2.2) – Boolean. Indicates whether the reports filtering cells on the grid should be visible (true) or not (false). Default value is true.
      • showTotals – Boolean. Indicates whether the totals are visible (true) or not (false).
      • title – String. Title of the grid.
      • type – String. Selected grid type. The following grid types are supported: "compact", "classic" and "flat".
    • selectEmptyCells (starting from v2.3) – Boolean. Indicates whether it is possible to select cells outside of the table. Default value is true.
    • showAggregations (starting from v2.0) – Boolean. Indicates whether the aggregation selection control is visible (true) or not (false) for measures on Fields List. Default value is true.
    • showCalculatedValuesButton (starting from v2.2) – Boolean. Controls the visibility of “Add calculated value” in Fields List. Default value is true.
    • showDefaultSlice (starting from v2.2) – Boolean. Defines whether the component selects a default slice for the report with empty slice (when nothing is set in rows, columns, pages and measures). If true, the first hierarchy from data goes to rows and the first measure goes to columns in the default slice. To avoid this default behavior, please set this property to false. Default value is true.
    • showMemberProperties (starting from v2.1) – Boolean. Indicates whether the member properties for OLAP data source are visible (true) or not (false) on Fields List. Default value is false.
    • sorting (starting from v2.0) – String. Indicates whether the sorting controls are visible in rows ("rows"), in columns ("columns"), in rows and columns ("on" or true) on the grid cells or not visible ("off" or false). Default value is "on".
    • viewType – String. Type of view to show: "grid" or "charts" or "grid_charts" (starting from v1.9).
  • conditions – Array of objects. Contains conditional formatting rules. Each object can have such properties:
    • formula – IF statement with 3 arguments: IF(CONDITION, TRUE STYLE, FALSE STYLE), where the false style is optional. Condition can contain AND, OR, ==, !=, >, <, >=, <=, -, +, *, /. #value is used to address the cell value in condition. Example: if(#value > 2, "trueStyle", "falseStyle").
    • trueStyle – style object that is applied to a cell if the condition for the cell value is met.
    • falseStyle – style object. If it is set it is applied to a cell if the condition for the cell value is not met.
    • row (optional) – row index to which the condition is applied.
    • column (optional) – column index to which the condition is applied.
    • measure (optional) – measure unique name to which the condition is applied.
    • hierarchy (optional) – hierarchy unique name to which the condition is applied.
    • member (optional) – hierarchy’s member unique name to which the condition is applied.
    • isTotal (optional) – Number. If it is -1 (not defined) – the condition is applied to all cells. If it is 0 (false) – the condition is applied to regular cells only. If it is 1 (true) – the condition will be applied to totals and subtotals cells only.
  • formats – Array of Format Objects.
  • tableSizes – Object. Contains information about table sizes:
    • columns – Array of objects. Each object is used to save and restore width of some column in report:
      • width – Number. Column width in pixels.
      • idx – Number. Index of the column, starts from 0.
      • tuple – Array. Consists of unique names that identifies the column in the table based on data in it.
      • measure(optional) – String. Measure unique name (this property is defined only if “[Measures]” is selected for columns in the slice). measure is used with tuple and is not set when idx is used.

      Please note, it’s necessary to use either idx or tuple, not both.

    • rows – Array of objects. Each object is used to save and restore height of some row in report:
      • height – Number. Row height in pixels.
      • idx – Number. Index of the row, starts from 0.
      • tuple – Array. Consists of unique names that identifies the row in the table based on data in it.
      • measure(optional) – String. Measure unique name (this property is defined only if “[Measures]” is selected for rows in the slice). measure is used with tuple and is not set when idx is used.

      Please note, it’s necessary to use either idx or tuple, not both.

  • localization – Property to set a localization. It can be inline JSON or URL to localization JSON file.

Examples

Example of report object:

{
    "dataSource": {
        "dataSourceType": "microsoft analysis services",
        "proxyUrl": "http://olap.flexmonster.com/olap/msmdpump.dll",
        "dataSourceInfo": "WIN-IA9HPVD1RU5",
        "catalog": "Adventure Works DW Standard Edition",
        "cube": "Adventure Works",
        "binary": false
    },
    "slice": {
        "rows": [
            {
                "uniqueName": "[Geography].[Geography]",
                "levelName": "[Geography].[Geography].[State-Province]",
                "filter": {
                    "members": [
                        "[Geography].[Geography].[City].&[Malabar]&[NSW]",
                        "[Geography].[Geography].[City].&[Lavender Bay]&[NSW]",
                        "[Geography].[Geography].[City].&[Matraville]&[NSW]",
                        "[Geography].[Geography].[City].&[Milsons Point]&[NSW]"
                    ],
                    "negation": true
                },
                "sort": "asc"
            },
            {
                "uniqueName": "[Sales Channel].[Sales Channel]",
                "sort": "asc"
            }
        ],
        "columns": [
            {
                "uniqueName": "[Measures]"
            }
        ],
        "measures": [
            {
                "uniqueName": "[Measures].[Reseller Order Count]",
                "aggregation": "none",
                "active": true,
                "format": "29mvnel3"
            }
        ],
        "expands": {
            "expandAll": false,
            "rows": [
                {
                    "tuple": [
                        "[Geography].[Geography].[Country].&[Australia]"
                    ]
                },
                {
                    "tuple": [
                        "[Geography].[Geography].[City].&[Lane Cove]&[NSW]"
                    ]
                }
            ]
        },
        "drills": {
            "drillAll": false,
            "rows": [
                {
                    "tuple": [
                        "[Geography].[Geography].[Country].&[Australia]"
                    ]
                },
                {
                    "tuple": [
                        "[Geography].[Geography].[State-Province].&[NSW]&[AU]"
                    ]
                },
                {
                    "tuple": [
                        "[Geography].[Geography].[City].&[Darlinghurst]&[NSW]"
                    ]
                }
            ]
        }
    },
    "options": {
        "viewType": "grid",
        "grid": {
            "type": "compact",
            "title": "",
            "showFilter": true,
            "showHeaders": true,
            "fitGridlines": false,
            "showTotals": true,
            "showGrandTotals": "on",
            "showExtraTotalLabels": false,
            "showHierarchies": true,
            "showHierarchyCaptions": true,
            "showReportFiltersArea": true,
            "pagesFilterLayout": "horizontal"
        },
        "chart": {
            "type": "bar",
            "title": "",
            "showFilter": true,
            "multipleMeasures": false,
            "oneLevel": false,
            "autoRange": false,
            "reversedAxes": false,
            "showLegendButton": false,
            "showAllLabels": false,
            "showMeasures": true,
            "showOneMeasureSelection": true,
            "showWarning": true,
            "activeMeasure": ""
        },
        "configuratorActive": true,
        "configuratorButton": true,
        "configuratorMatchHeight": false,
        "showAggregations": true,
        "showCalculatedValuesButton": true,
        "editing": false,
        "drillThrough": true,
        "showDrillThroughConfigurator": true,
        "sorting": "on",
        "datePattern": "dd/MM/yyyy",
        "dateTimePattern": "dd/MM/yyyy HH:mm:ss",
        "saveAllFormats": false,
        "showDefaultSlice": true,
        "showEmptyData": false,
        "defaultHierarchySortName": "asc",
        "selectEmptyCells": true,
        "showOutdatedDataAlert": false
    },
    "conditions": [
        {
            "formula": "if(#value < 40, 'trueStyle')",
            "trueStyle": {
                "backgroundColor": "#FFCCFF",
                "color": "#000033",
                "fontFamily": "Arial",
                "fontSize": 12
            },
            "falseStyle": {}
        }
    ],
    "formats": [
        {
            "name": "29mvnel3",
            "thousandsSeparator": " ",
            "decimalSeparator": ".",
            "decimalPlaces": -1,
            "maxDecimalPlaces": -1,
            "maxSymbols": 20,
            "currencySymbol": "$",
            "currencySymbolAlign": "left",
            "nullValue": "",
            "infinityValue": "Infinity",
            "divideByZeroValue": "Infinity",
            "textAlign": "right",
            "isPercent": false
        }
    ],
    "tableSizes": {
        "columns": [
            {
                "tuple": [],
                "measure": "[Measures].[Reseller Order Count]",
                "width": 182
            }
        ]
    },
    "localization": "loc-ua.json"
}