Dear visitor, despite the COVID-19 outbreak, our team continues operating at full speed.

Also, here is the form where you can apply for a special discount and we will contact you with possible options. Stay safe and continue achieving your business goals.

Fill the form
Get Free Trial
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. Filtering
      1. Filter Object
      2. Number Query Object
      3. String Query Object
      4. Date Query Object
      5. Time Query Object
      6. Value Query Object
    8. Format Object
    9. Conditional Format Object
    10. Cell Data Object
    11. Chart Data Object
    12. Toolbar 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. customizeAPIRequest
    13. customizeCell
    14. customizeContextMenu
    15. dispose
    16. expandAllData
    17. expandData
    18. exportTo
    19. getAllConditions
    20. getAllHierarchies
    21. getAllMeasures
    22. getCell
    23. getColumns
    24. getCondition
    25. getFilter
    26. getFlatSort
    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. openCalculatedValueEditor
    45. openFieldsList
    46. openFilter
    47. print
    48. refresh
    49. removeAllCalculatedMeasures
    50. removeAllConditions
    51. removeCalculatedMeasure
    52. removeCondition
    53. removeSelection
    54. runQuery
    55. save
    56. setFilter
    57. setFlatSort
    58. setFormat
    59. setOptions
    60. setReport
    61. setSort
    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. 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. update
  5. Custom data source API
    1. All requests
    2. /handshake request
    3. /fields request
    4. /members request
    5. /select request for pivot table
    6. /select request for flat table
    7. /select request for drill-through view
    8. Field Object
  6. MongoDB Connector API
    1. All methods
    2. getSchema
    3. getMembers
    4. getSelectResult
Table of contents

Data Source Object

The data source is a required part of the report object. Flexmonster supports data from OLAP data sources, Elasticsearch, SQL databases, MongoDB databases, the custom data source API, CSV and JSON static files, and inline JSON data. Each data source requires specific properties to be set inside the dataSource section of the report object. Here is a list of all available properties for a dataSource:

  • binary (optional) – Boolean. Flag to use Data Speed Accelerator instead of XMLA protocol. Only for MSAS and Mondrian data sources.
  • browseForFile (optional) – Boolean. Only for "csv" and "json" data source types. Defines whether you want to load a file from the local file system (true) or not (false). Default value: false.
  • catalog (optional) – String. The data source catalog name of the OLAP data source. Only for "microsoft analysis services", "mondrian" data source types.
  • cube (optional) – String. The given catalog’s cube’s name of the OLAP data source. Only for "microsoft analysis services", "mondrian" data source types.
  • data (optional) – JSON. A 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" data source types.
  • type (optional) – String. Type of data source. The component supports the following types: "microsoft analysis services", "mondrian", "elasticsearch", "api", "csv", 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".
  • thousandSeparator (optional) – String. Defines the specific character used to separate groups of digits in numbers. For example, to import CSV data with commas used to separate groups of digits in numbers (e.g. 1,000 for one thousand), set thousandSeparator parameter as ",".
  • filename (optional) – String. The URL to CSV or JSON file or to a 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). When set to true, CSV parsing is 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. Default value: true.
  • 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. Only for "microsoft analysis services", "mondrian" data source types. In case of Microsoft Analysis Services, both tabular and multidimensional model types are supported.
  • url (optional) – String. The path to the API endpoints. Only for "api" data source type.
  • 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: "↵".
  • 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 | Object. The parameter to set the server-side filter which helps to decrease the size of the response from the server. Only for "microsoft analysis services" and "elasticsearch" data source types. For "microsoft analysis services" data source type should be set as a string. 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]". For "elasticsearch" data source type should be set as a Bool Query Object.
  • requestHeaders (optional) – Object. For all data sources. This object allows you to add custom request headers. This object consists of "key": "value" pairs, where "key" is a header name and "value" is its value. Check out a live sample on JSFiddle. Important note: requestHeaders is not saved when obtaining the report via save() and getReport() API calls.
  • node (optional) – String | Object. The host for the connection. Only for "elasticsearch" data source type. Can be set either as a URL string ("node": "") or as an object with the following properties:
    • protocol – String. node URL protocol.
    • host – String. node URL hostname.
    • port – Number. node URL port.
    • path (optional) – String. node URL path.
  • index (optional) – String. The name of the Elasticsearch index to connect or the data set identifier for the custom data source API. Only for "elasticsearch" and "api" data source types.
  • withCredentials – Boolean. A flag to allow Windows authentification when connecting to Microsoft Analysis Services via both XMLA protocol and Flexmonster Accelerator. When set to false, Windows authentification is not allowed. Only for "microsoft analysis services" data source type. Default value: false.

The API calls connectTo(), updateData(), load(), and open() are used to change the data source at runtime. The API call save() is used to save the report.

Find more details about Data Source Object in this tutorial with examples.