☝️Small business or a startup? See if you qualify for our special offer.
+
All documentation

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. See the list of supported data sources.

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.

Properties

dataSource: {
browseForFile: boolean,
binary: boolean,
catalog: string,
concurrentRequests: boolean,
cube: string,
customData: string,
data: JSON,
dataRootPath: string,
dataSourceInfo: string,
effectiveUserName: string,
fieldSeparator: string,
filename: string,
ignoreQuotedLineBreaks: boolean,
index: string,
localeIdentifier: number,
mapping: MappingObject | string,
node: string,
proxyUrl: string,
requestHeaders: object,
roles: string,
singleEndpoint: boolean,
subquery: string | object,
thousandsSeparator: string,
type: string,
url: string,
useGranularityNamesForDateFilters: boolean,
useStreamLoader: boolean,
withCredentials: boolean
}
Property/TypeDescription
browseForFile
Boolean
optional Set browseForFile to true to load a file from the local file system. 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.
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.
catalog
String
optional The data source catalog name for multidimensional models.
If a tabular model is used, catalog is the database name.
Only for the "microsoft analysis services" data source type.
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.
cube
String
optional The data source catalog name for multidimensional models.
If a tabular model is used, cube is the model name.
Only for the "microsoft analysis services" data source type.
customData
String
optional The customData property is added to the connection string when connecting to a cube. Commonly used for user authorization. You can check out the Using the customData and SSAS thread.
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.
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.
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.
index
String
optional This property specifies the following:
  • The name of the Elasticsearch index for Elasticsearch.
  • The dataset identifier for the custom data source API.
  • The collection name for the MongoDB.
Only for the "elasticsearch" and "api" data source types.
localeIdentifier
Number
optional The Microsoft locale ID value for your language.
Only for the "microsoft analysis services" data source type.
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.
node
String
optional The URL to the Elasticsearch endpoint.
Only for the "elasticsearch" data source type.
proxyUrl
String
optional The URL to Flexmonster Accelerator or to the msmdpump.dll file.
Only for the "microsoft analysis services" data source type.
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.
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.
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.
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.
thousandsSeparator
String
optional If commas separate groups of digits in numbers (e.g., 1,000 for one thousand) in your CSV file, set the thousandsSeparator to ",".
Only for the "csv" data source type.
type
String
Type of data source. Flexmonster supports the following types: "json", "csv", "api", "microsoft analysis services", and "elasticsearch".
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.
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.

See also

Supported data sources
connectTo()
updateData()
load()
open()
save()