Menu
Download Free Trial
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:
    • 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]".

  • 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) – 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.

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

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].[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"
}