How to pass json at runtime to our Reports

4 posts, 0 answers
  1. Sri
    Sri avatar
    1 posts
    Member since:
    Aug 2019

    Posted 15 Aug 2019 Link to this post

    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

  2. Neli
    Admin
    Neli avatar
    254 posts

    Posted 20 Aug 2019 Link to this post

    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
  3. Peter
    Peter avatar
    1 posts
    Member since:
    Jan 2019

    Posted 16 Jan Link to this post

    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

  4. Neli
    Admin
    Neli avatar
    254 posts

    Posted 21 Jan Link to this post

    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
Back to Top