Pricing changes are coming in January. Contact our Sales team to secure the current price for your desired license.
All documentation
  • API Reference for older versions
  • DataSourceObject

    The data source is a required part of the ReportObject.

    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 ReportObject.

    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.

    For more details on the DataSourceObject usage, refer to this tutorial with examples: Data source.

    Properties

    dataSource: {
      mapping: MappingObject | string,
      binary: boolean,
      browseForFile: boolean,
      catalog: string,
      cube: string,
      data: JSON,
      dataRootPath: string,
      dataSourceInfo: string,
      type: string,
      effectiveUserName: string,
      fieldSeparator: string,
      thousandsSeparator: string,
      filename: string,
      ignoreQuotedLineBreaks: boolean,
      localeIdentifier: number,
      proxyUrl: string,
      url: string,
      roles: string,
      subquery: string | object,
      requestHeaders: object,
      singleEndpoint: boolean,
      node: string,
      index: string,
      useGranularityNamesForDateFilters: boolean,
      useStreamLoader: boolean,
      withCredentials: boolean,
      concurrentRequests: boolean
    }
    Property/TypeDescription
    mapping
    MappingObject | String
    optional Allows defining field data types, captions, multilevel hierarchies, grouping fields under separate dimensions, and setting other view configurations of hierarchies. It can be either an inline MappingObject or a URL to a JSON file with mapping.
    Live example
    binary
    Boolean
    optional Flag to use Data Speed Accelerator instead of XMLA protocol.
    Only for the "microsoft analysis services" data source type.
    Default value: false.
    browseForFile
    Boolean
    optional 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
    String
    optional The data source catalog name of the OLAP data source.
    Only for the "microsoft analysis services" data source type.
    cube
    String
    optional The given catalog's cube's name of the OLAP data source.
    Only for the "microsoft analysis services" data source type.
    data
    JSON
    optional A property to set JSON data if it is already on the page.
    dataRootPath
    String
    optional Specifies a path to a nested JSON property that contains data for Flexmonster Live example.
    This property works only for JSON data that is loaded via the filename property and is up to 30 MB in size. Also, ensure your data is specified in a supported JSON data format.
    The dataRootPath is not compatible with useStreamLoader.
    Only for the "json" data source type.
    dataSourceInfo
    String
    optional The service info of the OLAP data source.
    Only for the "microsoft analysis services" data source type.
    type
    String
    Type of data source. The component supports the following types: "json", "csv", "api", "microsoft analysis services", and "elasticsearch".
    effectiveUserName
    String
    optional Use when an end-user identity must be impersonated on the server. Specify the account in a domain\user format.
    Only for the "microsoft analysis services" data source type.
    fieldSeparator
    String
    optional Defines the specific fields separator to split each CSV row. There is no need to define it if the CSV fields are separated by , or ;. This property is required only if another character separates fields.
    For example, if you use TSV, where a tab character is used to separate fields, then the fieldSeparator parameter should be set to "\t".
    Alternatively, you can specify the field separator in the CSV file's first row using the sep prefix. Supported prefix formats are the following: sep=fieldSep and "sep=fieldSep". For example:
    sep=|
    Country|Color|Price
    Canada|blue|1000
    Only for the "csv" data source type.
    thousandsSeparator
    String
    optional Defines the specific character used to separate groups of digits in numbers. For example, if commas separate groups of digits in numbers (e.g., 1,000 for one thousand), set thousandsSeparator to ",".
    Only for the "csv" data source type.
    filename
    String
    optional The URL to a JSON/CSV file or a server-side script that generates JSON/CSV data.
    For JSON files, if your data is located in a nested property, specify a path to that property in the dataRootPath.
    Only for "csv" and "json" data source types.
    ignoreQuotedLineBreaks
    Boolean
    optional 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
    Number
    optional Microsoft Locale ID Value for your language.
    Only for the "microsoft analysis services" data source type.
    proxyUrl
    String
    optional The path to proxy URL to Microsoft Analysis Services. Both tabular and multidimensional model types are supported.
    Only for the "microsoft analysis services" data source type.
    url
    String
    optional The path to the API endpoints.
    Only for the "api" data source type.
    roles
    String
    optional 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.
    Only for the "microsoft analysis services" data source type.
    subquery
    String | Object
    optional The parameter to set the server-side filter, which helps decrease the size of the server's response. Only for "microsoft analysis services" and "elasticsearch" data source types.
    For the "microsoft analysis services" data source type, the subquery 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]" Live example.
    For the "elasticsearch" data source type, the subquery should be set as a BoolQueryObject Live example.
    requestHeaders
    Object
    optional For all data sources. This object allows you to add custom request headers. It consists of "key": "value" pairs, where "key" is a header name and "value" is its value.
    Live example
    Important note: requestHeaders is not saved when obtaining the report via save() and getReport() API calls.
    singleEndpoint
    Boolean
    optional When set to true, all custom data source API requests are sent to a single endpoint specified in the url property.
    Only for the "api" data source type. Default value: false.
    node
    String
    optional The URL string for the connection.
    Only for the "elasticsearch" data source type.
    index
    String
    optional The name of the Elasticsearch index to connect or the dataset identifier for the custom data source API.
    Only for "elasticsearch" and "api" data source types.
    useGranularityNamesForDateFilters
    Boolean
    optional Allows adjusting date filters to the cube structure.
    If set to true, date filters use granularityNames. If set to false, date filters use the unique name of the hierarchy being filtered.
    Only for the "microsoft analysis services" data source type.
    Default value: true.
    useStreamLoader
    Boolean
    optional Optimizes processing of large .json files using the stream loader. When set to true, the stream loader is enabled.
    Live example
    useStreamLoader works only when loading JSON files via URL. Not compatible with the dataRootPath property.
    Default value: false.
    withCredentials
    Boolean
    optional It indicates whether cross-site Access-Control requests should be made using credentials such as authorization headers (true) or not (false). For more details, refer to MDN web docs.
    Setting the withCredentials flag to true is recommended when using Windows authentication and other types of server authentications. When set to false, the browser does not ask for credentials and does not include them in outgoing requests.
    Default value: false.
    concurrentRequests
    Boolean
    optional When set to false, Flexmonster sends a request for each expand/drill-down separately and waits for the server’s response before sending a new request. This can result in slow performance when there are a lot of expands/drill-downs in the report. When the concurrentRequests is true, Flexmonster sends requests for expands/drill-downs of a particular level simultaneously.
    To get the best performance, enable the HTTP/2 protocol on your server.
    Only for the "api" data source type.
    Default value: false.

    See also

    Data source guide
    connectTo()
    updateData()
    load()
    open()
    save()