This is a migrated thread and some comments may be shown as answers.

How to pass json at runtime to our Reports

3 Answers 2017 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sri
Top achievements
Rank 1
Sri asked on 15 Aug 2019, 12:27 PM

Hi,

I am currently evaluating Telerik Reporting product.

Currently I have a WebApi project and a method which calls Reports Library. I have created a report with JsonDataSource with inline json. The method from Report library will use the report and create a PDF out of it. Everything works fine. Instead of inline json I would like to use the json passed from my webapi project.

Let me know how I can achieve it.

Thanks

3 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 20 Aug 2019, 07:19 AM
Hi Sri,

Instead of JsonDataSource, I suggest to use WebServiceDataSource. It allows you to display data which is located on a service in JSON format. At design time the component can be configured using the WebServiceDataSource Wizard. At run time the WebServiceDataSource automatically connects, authenticates to the service, and parses the retrieved JSON data. 

In order to use it, you need to add Telerik.Reporting.WebServiceDataSource DLL or the corresponding NuGet package in your application.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
answered on 16 Jan 2020, 11:18 AM

Good Day,

I have the same question. Although I understand the method proposed, I would still like to follow the method of passing the JSON data into the report (via the ItemDataBinding or NeedDataSource event I presume).

Could you confirm, if this scenario would in principle work?

Kind regards,

Peter

0
Neli
Telerik team
answered on 21 Jan 2020, 09:38 AM

Hello Peter,

You can test passing the JSON on NeedDataSource. Because basically we don't recommend the usage of events, you can also check How to set the content of JsonDataSource through report parameter KB article.

Regards,
Neli
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Sri
Top achievements
Rank 1
Answers by
Neli
Telerik team
Peter
Top achievements
Rank 1
Share this question
or