Getting all pages from a web service data source service URL

1 Answer 33 Views
Report Designer (standalone)
Brandon
Top achievements
Rank 1
Brandon asked on 08 Feb 2022, 12:51 AM

Hello,

We have an odata api that limits the maximum number of records that can be returned to the client to 1000 records. The service allows for query parameters $top and $skip that allow us to page through the data, which works great in kendo grids, etc. For reporting though, I'm wondering if there's any way using the web service data source to somehow auto-page through data until it gets through all of the pages of data, that way we get all of the data from the api server without worrying about only being able to retrieve the fist page of 1000 records only? Is this a thing?

Thank you in advance!

Brandon

1 Answer, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 10 Feb 2022, 03:15 PM

Hi Brandon,

If I understood correctly, you would like to download the entire data, possibly more than the Odata API would allow you to fetch at a time, and render the report with all the data.

Generally, the Reporting engine needs all the data when processing the report and before starting to render. The reason is that the Telerik Reporting tool was designed with printing in mind, which includes pagination that depends on the rendering format. The correct pagination requires each item to have its location and size set before rendering, which requires the data to be available. That said, all the data should be available during the rendering, hence you cannot achieve the requirement with a single WebServiceDataSource. The latter is not designed to retrieve the data in multiple portions.

As a workaround, you may use several WebServiceDataSources assigned, for example, to different tables. Each of them may fetch up to the allowed 1000 items. This way, all the data will be displayed in portions in several tables/data items rather than one.

If you prefer to display all the data in a single data item, you may use ObjectDataSource. You may feed it with data from the web service with custom code that takes care of the limitation of the Odata API.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Brandon
Top achievements
Rank 1
commented on 10 Feb 2022, 06:06 PM

Hi Todor, that's exactly right and thank you for taking the time for providing a good explanation and some possible alternatives. I did think about having multiple WebServiceDataSources, but that's really awkward, especially when not knowing how many I would need per tenant. I think the ObjectDataSource route looks very promising, so I will check that out.

Thank you!

Tags
Report Designer (standalone)
Asked by
Brandon
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or