How to build a data source on webapi
The backend provides several API interfaces. How can I use the API interface of ULR as a data source?
This discussion has been closed.
The backend provides several API interfaces. How can I use the API interface of ULR as a data source?
Comments
Hello!
In the designer, select ‘Add Data Source’ -> ‘JSON’ -> ‘From URL’ and specify the API endpoint (including authorisation headers where necessary).
Programmatically, this is done using `JsonDataSourceConnectionStringBuilder`:
RegisteredObjects.AddConnection(typeof(FastReport.Data.JsonConnection.JsonDataSourceConnection)); var conn = new JsonDataSourceConnection { ConnectionString = new JsonDataSourceConnectionStringBuilder { Json = ‘https://api.example.com/orders’ }.ToString() }; report.Dictionary.Connections.Add(conn); conn.CreateAllTables();