How to Use JSON Parameter to Dynamically Set TextBox Values in a Report?

1 Answer 86 Views
Report Parameters
Arifullah
Top achievements
Rank 2
Iron
Iron
Iron
Arifullah asked on 26 Nov 2024, 08:23 AM

Hi,

I am trying to pass a parameter of JSON type to my Telerik Report, like this:

json
{ "orderNo": "Order No", "customer": "Customer", "date": "Date" }

or in Arabic:

json
{ "orderNo": "رقم الطلب", "customer": "العميل", "date": "التاريخ" }

I want to use these values dynamically in my report's TextBox. For example, to display the value of "date", I tried the following approaches, but neither worked:

  1. =Parameters.Columns.Value("date")

I am doing this because I want to dynamically pass translated field labels to the report. Could you please guide me on the correct way to achieve this?

Thank you!

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 29 Nov 2024, 06:12 AM

Hi Arifullah,

Indeed, the Report Parameters may have values with particular types. When you pass JSON as a value to a Report Parameter it is treated as String and its properties cannot be determined automatically.

As a workaround, you may use a List with JsonDataSource, which Source is bound to the parameter as explained in the KB article How to set the content of JsonDataSource through report parameter.

Regards,
Todor
Progress Telerik

Stay tuned by visiting our roadmap and feedback portal pages, enjoy a smooth take-off with our Getting Started resources, or visit the free self-paced technical training at https://learn.telerik.com/.
Tags
Report Parameters
Asked by
Arifullah
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Todor
Telerik team
Share this question
or