We have prepared a sample .NET Core server that implements the Flexmonster custom data source API. It is available at the
server-dotnetcore/ folder on the api-data-source GitHub repository.
All requests from Flexmonster Pivot Table are handled by
http://localhost:3400/api/cube endpoints. Raw data is stored in JSON format in the
data/ folder. The file name matches the
index property of the
dataSource configuration object.
.zip archive with the sample project or clone it from GitHub with the following command:
git clone https://github.com/flexmonster/api-data-source my-proj
To start the server, run the following commands in a console:
On the client side (see
client/index.html), the report is configured as follows:
By default, the server uses the data stored in JSON format. This option can be configured in
If you want to use CSV, you need to change it like this:
To use a database you must add the type of a database (MySQL, MSSQL, and PostgreSQL are supported), add the connection string and a query to retrieve data. The
DatabaseType property must be one of the following:
postgresql. On the client side,
index in the configuration must be one from
Indexes property. It will execute the query you specified.
Note that the server can work only with one data source at the same time.
You may be interested in the following articles: