Data source
Products: FastReport Cloud, FastReport Corporate Server, FastReport Publisher
A data source (DataSource) is a resource for accessing data. This resource stores a connection string compatible with connections in the FastReport .NET library.
Each data source is linked to a workspace. By default, a workspace does not have any data sources.
Properties
The data source contains the following properties.
Id— unique identifier of the data source.Name— displayed name, used solely for user convenience.ConnectionType— connection type, the name of the connector from the FastReport .NET library, can take one of the following values:JSON,MSSQL,CSV,XML,MySQL,PostgreSQL,OracleDB.ConnectionString— connection string compatible with the FastReport .NET library.DataStructure— data structure, a fragment of information from the.frx, report template, used by the online designer. It is automatically generated after creating a new data source.SelectCommands— list of SQL commands, based on which additional tables displayed in theDataStructureare create.
User permissions
User permissions for sources are divided into 4 categories:
Get— getting any information about the data source.Entity— information about the data source: data source ID, displayed name, etc.Permission— information about user permissions for access to the data source.
Update— updating data source properties.Name— changing the data source name.SubscriptionId— changing the workspace to which the data source belongs.DataStructure— modifying the data structure.ConnectionString— changing the connection string.
Delete— deleting resources directly related to the data source.Entity— deleting the data source.
Administrate— administrative access to data source permissions.Owner— editing the data source owner and associated permissions.Group— editing user group permissions.Other— editing workspace user permissions.Anon— editing anonymous access permissions to the data source.
User Tables
Based on SQL queries passed to SelectCommands arbitrary tables can be created.
Each object in the command list has the following fields:
Name- name of the future table.Command- SQL command; special symbols are used to define parameters in the command, for example:@(select * from Students where id>@idParam); The symbols may differ depending on the data source.Parameters- list of parameters passed in the SQL command.
The query parameters have the following properties:
Name- parameter name; must match the name in the query.DataType- data type.DefaultValue- default value; used if not otherwise specified when passing the parameter.Size- parameter size; can be omitted in most cases.
The list of data types may differ for different data sources. To view the current list, make a request to `api/data/v1/DataSources/parameterTypes/{dataSourceType}, where dataSourceType is the name of the data source.
Currently, the following data sources are supported: JSON, MSSQL, CSV, XML, MySQL, Postgres, OracleDB, FirebirdDB, MongoDB, ClickHouse. The current list can be found at the /api/swagger in the DataSourceConnectionType enumeration.