The Bold Reports supports connecting OData web services through REST API.
To configure the OData data source, follow the below steps:
DATA
configuration panel, click on the NEW DATA
button.
OData
data source type.
After clicking the data source, the NEW DATASOURCE
configuration panel opens. Follow the below steps to create OData data source:
Specify the data source name without special characters, in Name field.
Enter a valid OData REST API endpoint in the URL textbox. Refer the OData API documentation for more details.
Example: https://services.odata.org/V4/Northwind/Northwind.svc/Orders
Choose one of the Method from the drop-down for the provided REST API. Options are GET and POST.
If required by the REST API, provide key value pairs in Headers.
Choose a Data Format from the drop-down based on the response of your provided REST API. Options are JSON and XML.
Choose an Authentication Type supported by the data source. Options are Basic http authentication
and None
. Learn more about Authentication Types.
If you choose GET
method type, the basic configuration looks something similar to below image,
Based on the REST API service which you use, pass the headers, parameters or raw data, data format and authentication type.
Click on the Connect
to proceed with query design pane. The left pane will show the key fields of JSON data retrieved from OData Rest API request.
Drag and drop the table from the left pane in the query design view page and execute. Its corresponding values will be shown in grid for preview.
Note: In schema tree, the nested fields in the specified OData service will be shown as flat structure.
Click Finish
to save the data source with a relevant name to proceed with designing report.
You can choose the Data format of the response for the provided Rest API in the Data format drop-down.
Once you select the CSV format, the Separator
options will show as below. You can choose the separator from the given options.
You can set authentication type, either as None or Basic HTTP Authentication.
Use None type in following cases,
Use Basic Http authentication, if your OData service requires username and password to authenticate. Choose Basic HTTP Authentication under Authentication Type and input the username and password.
You can pass dynamic values for URL, headers, and parameters using Expressions. To set an expression for required fields, click on the square icon provided for respective field. For example, follow the below steps to set expression for URL field.
Expression
option from the menu,
<<Exp>>
,
To reset the expression, choose Reset
option from the menu. Specify other required connection settings and click Connect
. Once you click on connect for the first time, it will prompt for a actual URL to load data in query design.
Enter a direct URL value instead of expression and click OK
.
The above action will take you to query design view.
Similarly, you can set and reset expression for all the fields which supports expression.
https://services.odata.org/V4/Northwind/Northwind.svc/Order_Details
https://services.odata.org/V4/Northwind/Northwind.svc/Customers
https://services.odata.org/V4/Northwind/Northwind.svc/Regions
https://services.odata.org/V4/Northwind/Northwind.svc/Orders
https://services.odata.org/TripPinRESTierService