1. API reference
    1. Introduction
    2. Flexmonster()
  2. Objects
    1. All objects
    2. Report Object
    3. Slice Object
    4. Options Object
    5. Format Object
    6. Conditional Format Object
    7. Cell Data Object
  3. Methods
    1. All methods
    2. addCalculatedMeasure
    3. addCondition
    4. alert
    5. clear
    6. clearFilter
    7. clearXMLACache
    8. closeFieldsList
    9. collapseAllData
    10. collapseData
    11. connectTo
    12. customizeCell
    13. customizeContextMenu
    14. dispose
    15. expandAllData
    16. expandData
    17. exportTo
    18. getAllConditions
    19. getAllHierarchies
    20. getAllMeasures
    21. getCell
    22. getColumns
    23. getCondition
    24. getData
    25. getFilter
    26. getFilterProperties
    27. getFormat
    28. getMeasures
    29. getMembers
    30. getOptions
    31. getReport
    32. getReportFilters
    33. getRows
    34. getSelectedCell
    35. getSort
    36. getXMLACatalogs
    37. getXMLACubes
    38. getXMLADataSources
    39. getXMLAProviderName
    40. load
    41. off
    42. on
    43. open
    44. openFieldsList
    45. openFilter
    46. print
    47. refresh
    48. removeAllCalculatedMeasures
    49. removeAllConditions
    50. removeCalculatedMeasure
    51. removeCondition
    52. removeSelection
    53. runQuery
    54. save
    55. setBottomX
    56. setFilter
    57. setFormat
    58. setOptions
    59. setReport
    60. setSort
    61. setTopX
    62. showCharts
    63. showGrid
    64. showGridAndCharts
    65. sortingMethod
    66. sortValues
    67. updateData
  4. Events
    1. All events
    2. afterchartdraw
    3. aftergriddraw
    4. beforegriddraw
    5. beforetoolbarcreated
    6. cellclick
    7. celldoubleclick
    8. datachanged
    9. dataerror
    10. datafilecancelled
    11. dataloaded
    12. exportcomplete
    13. exportstart
    14. fieldslistclose
    15. fieldslistopen
    16. filteropen
    17. loadingdata
    18. loadinglocalization
    19. loadingolapstructure
    20. loadingreportfile
    21. localizationerror
    22. localizationloaded
    23. olapstructureerror
    24. olapstructureloaded
    25. openingreportfile
    26. printcomplete
    27. printstart
    28. querycomplete
    29. queryerror
    30. ready
    31. reportchange
    32. reportcomplete
    33. reportfilecancelled
    34. reportfileerror
    35. runningquery
    36. update
Table of contents

Report Object

All the possible aspects of pivot tables and pivot charts configuration can be set via report object. The component supports saving reports and loading of previously saved ones.

Report object has the following properties:

  • dataSource – Object. Contains information about data source:
    • binary (optional) – Boolean. Flag to use Data Speed Accelerator instead of XMLA protocol. Only for MSAS and Mondian data sources.
    • browseForFile (optional) – 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 sources.
    • catalog (optional) – String. The data source catalog name of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • cube (optional) – String. Given catalog’s cube’s name of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • data (optional) – Property to set JSON data if it is already on the page.
    • dataSourceInfo (optional) – String. The service info of the OLAP data source (only for "microsoft analysis services", "mondrian", "iccube" data source types).
    • dataSourceType (optional) – String. Type of data source. The component supports the following types: "microsoft analysis services", "mondrian", "iccube", "csv", "ocsv" and "json".
    • effectiveUserName (optional) – String. Use when an end user identity must be impersonated on the server. Specify the account in a domain\user format. Only for "microsoft analysis services" data source type.
    • fieldSeparator (optional) – 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 (optional) – 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 (optional) – 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.
    • localeIdentifier (optional) – Number. Microsoft Locale ID Value for your language. Only for "microsoft analysis services" data source type.
    • proxyUrl (optional) – 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). In case of Microsoft Analysis Services, both tabular and multidimensional model types are supported.
    • recordsetDelimiter (optional) – String. Defines which char is used in CSV to denote the end of CSV row (only for CSV data source type). Default value is "↵".
    • roles (optional) – String. Comma-delimited list of predefined roles to connect to a server or database using permissions conveyed by that role. If this property is omitted, all roles are used, and the effective permissions are the combination of all roles. Supported only for "microsoft analysis services" and "mondrian" data sources.
    • subquery (optional) – 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]".
    • requestHeader (optional) – Object. This object allows adding custom request headers (only for "csv" and "json" data source types). The object consists of "key": "value" pairs, where "key" is a header name and "value" is its value. Check out live sample on JSFiddle. Important note: requestHeader is not saved when obtaining the report via save() and getReport() API calls.

  • sliceSlice Object. There you can define fields that go to rows, go to columns and go to measures, add filtering, sorting, report filtering, expands and drills.

  • optionsOptions Object. Allows configuration of component’s UI and functionality for customers.

  • conditions – Array of Conditional Format Objects.

  • 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) – Object. Identifies the measure (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. Has the following properties:
        • uniqueName – String. Unique measure name.
        • aggregation (optional) – String. Measure aggregation type.
      • 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) – Object. Identifies the measure (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. Has the following properties:
        • uniqueName – String. Unique measure name.
        • aggregation (optional) – String. Measure aggregation type.
      • Please note, it’s necessary to use either idx or tuple, not both.
  • customFields – Array of objects. Allows setting custom fields for Excel export or storing some additional information. They are not shown on the grid but they will be displayed in exported Excel table. Each object has the following properties:
    • name – String. Name of the custom field.
    • measure – String. Value of the custom field.
  • localization – Property to set a localization. It can be inline JSON or URL to localization JSON file.

You can get the report using getReport() API call. To set the report use setReport() API call.

To learn more about the usage of Report Object, please refer to What is a report tutorial.

Example

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].[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": "on",
            "showGrandTotals": "on",
            "showExtraTotalLabels": false,
            "showHierarchies": true,
            "showHierarchyCaptions": true,
            "showReportFiltersArea": true
        },
        "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": false,
        "configuratorButton": true,
        "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": "#value < 40",
            "format": {
                "backgroundColor": "#FFCCFF",
                "color": "#000033",
                "fontFamily": "Arial",
                "fontSize": "12px"
            }        }
    ],
    "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"
}