☝️Small business or a startup? See if you qualify for our special offer.
+
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 Defines how fields from the data source are treated and presented within the component. For example, you can specify the field’s captions, define a type for a field, configure multilevel hierarchies, etc. Read more in the Mapping guide.
    Can be either an inline MappingObject or a URL to a JSON file with the mapping
    Live example.
    binary
    Boolean
    optional Indicates whether to use Flexmonster Accelerator or the XMLA protocol. When set to true, Flexmonster will use Flexmonster Accelerator.
    Only for the "microsoft analysis services" data source type.
    Default value: false.
    browseForFile
    Boolean
    optional Define browseForFile to load a file from the local file system. When set to true, this property opens the file manager, where you can select the necessary file with the data Live example.
    Only for "csv" and "json" data source types.
    Default value: false.
    catalog
    String
    optional The data source catalog name.
    Only for the "microsoft analysis services" data source type.
    cube
    String
    optional The catalog's cube's name.
    Only for the "microsoft analysis services" data source type.
    data
    JSON
    optional The inline JSON data Live example.
    Only for "json" data source type.
    dataRootPath
    String
    optional The 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. Flexmonster supports the following types: "json", "csv", "api", "microsoft analysis services", and "elasticsearch".
    effectiveUserName
    String
    optional Specify this property when an end-user identity must be impersonated on the server. Specify the account in the 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 If commas separate groups of digits in numbers (e.g., 1,000 for one thousand) in your CSV file, 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 line breaks in quotes should be ignored (true) or not (false). When set to true, CSV parsing is faster. Set this property to false only if your data source has important line breaks in quotes. Note that this might slow down CSV parsing a little bit.
    Only for the "csv" data source type.
    Default value: true.
    localeIdentifier
    Number
    optional The Microsoft locale ID value for your language.
    Only for the "microsoft analysis services" data source type.
    proxyUrl
    String
    optional The URL to the Flexmonster Accelerator or to the msmdpump.dll file.
    Only for the "microsoft analysis services" data source type.
    url
    String
    optional The URL to the server’s endpoint that handles Flexmonster's custom data source API requests.
    Only for the "api" data source type.
    roles
    String
    optional A comma-delimited list of predefined roles to connect to a server or a database using the permissions defined by that role.
    If this property is omitted, all roles are used and the effective permissions are the combination of all roles. For example, to combine "admin" and "manager" roles, set the roles property like so: roles: "admin,manager".
    Only for the "microsoft analysis services" data source type.
    subquery
    String | Object
    optional Sets a server-side filter to decrease the size of the response from the server. 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. For example, to show reports for only one specific year set the subquery like so: "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 Adds custom request headers. Consists of "key": "value" pairs, where "key" is a header name and "value" is its value.
    Live example
    Note The requestHeaders property 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 to the Elasticsearch endpoint.
    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 Adjusts date filters to the cube structure.
    When set to true, date filters use granularityNames. When 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.
    Only for the "json" data source type.
    Default value: false.
    withCredentials
    Boolean
    optional 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 authentication. 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()