How to set Pagination to my report

1 Answer 685 Views
Performance Report Designer - Web
Ahmed
Top achievements
Rank 1
Ahmed asked on 10 May 2022, 09:21 AM

Hi , 

My report datasource retrieve many records (may be millions) and I want to paginate them to show only 10 records for example but always it shows data as 1 page with all data and I can not find any configuration in my report designer to handle this 

 

Thanks

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 13 May 2022, 07:10 AM

Hello Ahmed,

You may introduce groups to your Table/List/Crosstab or to the Report itself. Then, you would be able to use the PageBreak property of the corresponding groups (for Table groups) or Group Header/Footer sections (for Report groups). Here are the relevant articles:

As a grouping criteria, you may use an Integer indexing field of the data and an Expression like the following:

=Fields.Index / 10

Note that the division should be an Integer division in order to generate a separate group, for each group of ten data rows.

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/.
Suhail
Top achievements
Rank 1
commented on 05 Dec 2023, 04:06 PM

Is pagination a complex requirement? Why is such a basic requirement not straight-forward? Why does it need to be so unintuitive and complicated?
Todor
Telerik team
commented on 07 Dec 2023, 09:57 AM

Hi Suhail,

Can you elaborate on the complexity of the pagination in Telerik Reporting?

Generally, it is straightforward and the user doesn't need to take care of it, as it happens automatically. The PageSettings are used in the hard pagination algorithms to split the content into pages so that each page is readable and printable. I suggest the article Understanding Pagination for details.

Apart from that, we provide also mechanisms for forcing custom page breaks, which may be very useful in many scenarios.

We will appreciate your additional feedback and more specific recommendations for improving the functionality.

Suhail
Top achievements
Rank 1
commented on 07 Dec 2023, 10:33 AM

I have looked at the article you shared. It talks about pagination in printed form, which is not what I was looking for.

I want the report viewer (and Preview view from Report Designer for that matter) to be able to display a table using pagination, WITHOUT using the PrintPreview mode. There are many use cases for this. Say I want to view the contents on the screen only, with however many columns I have in the report all showing up in a nice table, much like a regular grid, using pagination, and most definitely not loading the contents of the entire report in one go. I did not find a way to achieve this, meaning view some records from such a report without loading all 1 million records first. Hope there is a way to something as basic as this.

Todor
Telerik team
commented on 11 Dec 2023, 11:45 AM

Hello Suhail,

Telerik Reporting is designed with printing in mind, hence the specifics related to pagination, etc.

Generally, each report should be rendered completely before being presented to the user. This also relates to the initial idea of the product to generate reports for printing.

If you need to display reports partially, you may filter their data, for example, based on a Report Parameter. The user may select a value for the parameter and render the report only with the corresponding content. This will let you reduce the size of the rendered table, and speed up report generation by using less data - see Filtering Data.

Regarding table pagination, currently, you may achieve it with Table Groups that support PageBreaks.

Suhail
Top achievements
Rank 1
commented on 12 Dec 2023, 05:29 AM

Thanks for your response. I still believe it is not a good idea to limit this otherwise very capable reporting engine to be able to paginate only in print view. I think it is perfectly valid requirement to be able to view the report for screen only purposes. I also don't think it is in any way difficult to implement this capability.

That said, any article showing to achieve this with table groups?

Todor
Telerik team
commented on 14 Dec 2023, 11:51 AM

Hi Suhail,

I have attached a demo report with a Table group page break. Here is a link to a muted video on how it works from the Standalone Report Designer. Note that the paging is available in the default Interactive View mode as well as in the Print Preview mode.

For the table groups, you may check the article Adding Groups to Table and Crosstab Items.

Suhail
Top achievements
Rank 1
commented on 14 Dec 2023, 01:55 PM

In your example, if the groups gA, gB and gC had 1, 2 and 3 rows respectively, I would see 1, 2 and 3 rows in the three pages, right, even though these 6 rows could fit in a single page? This is ridiculous. This is not what I want to do. I want to view the report like a regular grid. This is not difficult to understand what regular grid means. Can you please tell me if that's doable or not?
Todor
Telerik team
commented on 19 Dec 2023, 09:04 AM

Hello Suhail,

Indeed, the demo is just a sample of table grouping. You may group by any criteria that will suit your needs.

For example, if you need a pagination by a particular number of records, let's say 20, you may introduce an index in the data fields and use an Expression like '= index / 20' for grouping. This will let you have the first 20 records (from index 0 to 19) in the first group instance, hence on the first page, then indices from 20 to 39 on the next page, etc.

Dan
Top achievements
Rank 1
commented on 11 Jan 2024, 05:34 PM

Hi Todor,

Even we are facing same problem. we have implemented pagination as you have suggested here using expression '=index/20'; however, this hinders our sort options. e.g. if I have 100 records - and each page I am displaying 20 records - so total 5 pages I get. When I am trying to sort based on e.g. EmpId - it doesn't sort all 100 records - it just sort 20 records which are displayed on that page.

Also, if I go with use "Print Preview" - that adds pagination by default, but I loose sorting option in that case.

Is there any  way I can get both Pagination as well as Sorting?

Thanks

Todor
Telerik team
commented on 16 Jan 2024, 01:40 PM

Hi Dan,

You need to sort your data before you assign indexes. The reason is that the grouping is on the index, and when you sort before the grouping, each value will be placed in the corresponding group based on its index and then displayed on its sorting position within the group. That said, you need to ensure the indexing of your data is based on the order it should appear in the report/table.

The above may be achieved if you pass already sorted data to the report, with the correct indexes.

 

Tags
Performance Report Designer - Web
Asked by
Ahmed
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or