New to Telerik Reporting? Download free 30-day trial

How to set the content of JsonDataSource through report parameter

Environment

Product Version 13.1.19.514 +
Product Progress® Telerik® Reporting

Description

Sometimes you want to change the content of JSON DataSource or to set it in runtime.

Solution

If you have a table in the report and the datasource is assigned to it, firstly you need to create the report parameter which has to be from Type String. In the table, you need to add a declaration for each field (for instance: =Fields.Name and so on).

To set the content of the JsonDataSource to be the report parameter's value, use the following Binding in the table:

Property path: DataSource.Source
Expression: = Parameters.Parameter1.Value

The same approach can be applied if the datasource is assigned to the report or any other data item. In this case, the Binding has to be added to the report/ data item.

Notes

The demo report can be downloaded from here.

In this article