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
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:
- How to Add groups to Table item and Crosstab item
- How to Add groups to Report
- Paging and Keep Together
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
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.
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.
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.
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?
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.
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.
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
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.