From 87a8aff74f7f2beabf4cb0928b76c93c56f939fe Mon Sep 17 00:00:00 2001 From: KB Bot Date: Mon, 15 Sep 2025 13:36:42 +0000 Subject: [PATCH 1/3] Added new kb article group-specific-page-numbering-telerik-reporting --- ...ecific-page-numbering-telerik-reporting.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 knowledge-base/group-specific-page-numbering-telerik-reporting.md diff --git a/knowledge-base/group-specific-page-numbering-telerik-reporting.md b/knowledge-base/group-specific-page-numbering-telerik-reporting.md new file mode 100644 index 000000000..3eea0dbb3 --- /dev/null +++ b/knowledge-base/group-specific-page-numbering-telerik-reporting.md @@ -0,0 +1,91 @@ +--- +title: Numbering Pages Based on Group Scope in Telerik Reporting +description: Learn how to configure page numbering within groups in Telerik Reporting to display relative page numbers for each group. +type: how-to +page_title: Group-Specific Page Numbering in Telerik Reporting +meta_title: Group-Specific Page Numbering in Telerik Reporting +slug: group-specific-page-numbering-telerik-reporting +tags: reporting, page numbering, groups, page functions, telerik reporting +res_type: kb +ticketid: 1698535 +--- + +## Environment + + + + + + + + + + + +
Product Reporting
Version 19.1.25.521
+ +## Description + +I need page numbering based on a specific group in Telerik Reporting. Instead of absolute page numbers, I want the numbering to reset within each group. For example, if there are two pages per group, the numbering should appear as "Page 1 of 2" and "Page 2 of 2" for the first group, then reset to "Page 1 of 2" for the next group. This numbering should reflect the pages within the group scope. + +This knowledge base article also answers the following questions: +- How to reset page numbers within each group in Telerik Reporting? +- How to use PageNumber and PageCount functions with group scope? +- How to implement group-specific page numbering in a report? + +## Solution + +To implement group-specific page numbering, follow these steps: + +### Using Built-in Page Functions +1. Open the report in the Telerik Reporting Designer. +2. Define a group for the desired field (e.g., `ResidentID`) at the report level if not already done. Ensure the grouping is applied directly on the report, not inside a list item. +3. Add a TextBox to the page footer. +4. Use the following expression to display page numbering within the group: + ``` + ="Page " + PageNumber("residentGroup", Fields.ResidentID) + " of " + PageCount("residentGroup", Fields.ResidentID) + ``` + - Replace `"residentGroup"` with your group's name. + - Replace `Fields.ResidentID` with the key field of the group. +5. Assign the data source directly to the report to ensure the group scope functions correctly. + +### Using a Custom Function +If the built-in functions do not meet your requirements, you can create a custom user function: +1. Create a static class with a method to track page numbers per group. +2. For example: + ```csharp + public static class PageHelper + { + private static Dictionary groupPageNumbers = new Dictionary(); + + public static string MyPageNumber(string groupKey, int currentPage) + { + if (!groupPageNumbers.ContainsKey(groupKey)) + { + groupPageNumbers[groupKey] = 1; + } + else + { + groupPageNumbers[groupKey]++; + } + + return $"Page {groupPageNumbers[groupKey]}"; + } + } + ``` +3. Register the custom assembly in the Telerik Reporting Designer. +4. Use the custom function in the page footer, passing the group identifier and the current page number. + +### Adjusting the Report Layout +Ensure that the group is defined at the report level rather than inside a list item. This allows page functions to work correctly within the intended group scope. + +### Sample Report +Refer to the provided sample report for an implementation where the data source is directly assigned to the report, and the group is created at the report level. + +## See Also + +- [Page Functions Explained - Telerik Reporting](https://docs.telerik.com/reporting/designing-reports/connecting-to-data/expressions/expressions-reference/functions/page-functions) +- [Grouping Data in Reports](https://docs.telerik.com/reporting/designing-reports/organizing-data/grouping-data) +- [Custom Functions in Telerik Reporting](https://docs.telerik.com/reporting/designing-reports/expressing-data/custom-functions) + + From 4381e15722675d381d8ee5c98a4b4a092c186f2a Mon Sep 17 00:00:00 2001 From: IvetNikolova <118352332+IvetNikolova@users.noreply.github.com> Date: Mon, 15 Sep 2025 16:49:17 +0300 Subject: [PATCH 2/3] Update group-specific-page-numbering-telerik-reporting.md --- ...ecific-page-numbering-telerik-reporting.md | 83 +++++-------------- 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/knowledge-base/group-specific-page-numbering-telerik-reporting.md b/knowledge-base/group-specific-page-numbering-telerik-reporting.md index 3eea0dbb3..53885e856 100644 --- a/knowledge-base/group-specific-page-numbering-telerik-reporting.md +++ b/knowledge-base/group-specific-page-numbering-telerik-reporting.md @@ -1,5 +1,5 @@ --- -title: Numbering Pages Based on Group Scope in Telerik Reporting +title: Numbering Pages Based on Group Scope description: Learn how to configure page numbering within groups in Telerik Reporting to display relative page numbers for each group. type: how-to page_title: Group-Specific Page Numbering in Telerik Reporting @@ -12,80 +12,43 @@ ticketid: 1698535 ## Environment - - - - - - - - - - + + + + + + + + + +
Product Reporting
Version 19.1.25.521
Product Reporting
Version 19.1.25.521
## Description -I need page numbering based on a specific group in Telerik Reporting. Instead of absolute page numbers, I want the numbering to reset within each group. For example, if there are two pages per group, the numbering should appear as "Page 1 of 2" and "Page 2 of 2" for the first group, then reset to "Page 1 of 2" for the next group. This numbering should reflect the pages within the group scope. - -This knowledge base article also answers the following questions: -- How to reset page numbers within each group in Telerik Reporting? -- How to use PageNumber and PageCount functions with group scope? -- How to implement group-specific page numbering in a report? +I need page numbering based on a specific group using Standalone Designer. Instead of absolute page numbers, I want the numbering to reset within each group. For example, if there are two pages per group, the numbering should appear as "Page 1 of 2" and "Page 2 of 2" for the first group, then reset to "Page 1 of 2" for the next group. This numbering should reflect the pages within the group scope. ## Solution To implement group-specific page numbering, follow these steps: ### Using Built-in Page Functions -1. Open the report in the Telerik Reporting Designer. -2. Define a group for the desired field (e.g., `ResidentID`) at the report level if not already done. Ensure the grouping is applied directly on the report, not inside a list item. -3. Add a TextBox to the page footer. -4. Use the following expression to display page numbering within the group: +1. Open the report in the Standalone Designer. +1. Define a group for the desired field (e.g., `ResidentID`) at the report level if not already done. +1. Add a TextBox to the page footer. +1. Use the following expression to display page numbering within the group: + ``` ="Page " + PageNumber("residentGroup", Fields.ResidentID) + " of " + PageCount("residentGroup", Fields.ResidentID) ``` + - Replace `"residentGroup"` with your group's name. - Replace `Fields.ResidentID` with the key field of the group. -5. Assign the data source directly to the report to ensure the group scope functions correctly. - -### Using a Custom Function -If the built-in functions do not meet your requirements, you can create a custom user function: -1. Create a static class with a method to track page numbers per group. -2. For example: - ```csharp - public static class PageHelper - { - private static Dictionary groupPageNumbers = new Dictionary(); - - public static string MyPageNumber(string groupKey, int currentPage) - { - if (!groupPageNumbers.ContainsKey(groupKey)) - { - groupPageNumbers[groupKey] = 1; - } - else - { - groupPageNumbers[groupKey]++; - } - - return $"Page {groupPageNumbers[groupKey]}"; - } - } - ``` -3. Register the custom assembly in the Telerik Reporting Designer. -4. Use the custom function in the page footer, passing the group identifier and the current page number. - -### Adjusting the Report Layout -Ensure that the group is defined at the report level rather than inside a list item. This allows page functions to work correctly within the intended group scope. - -### Sample Report -Refer to the provided sample report for an implementation where the data source is directly assigned to the report, and the group is created at the report level. + +1. Assign the data source directly to the report to ensure the group scope functions correctly. ## See Also -- [Page Functions Explained - Telerik Reporting](https://docs.telerik.com/reporting/designing-reports/connecting-to-data/expressions/expressions-reference/functions/page-functions) -- [Grouping Data in Reports](https://docs.telerik.com/reporting/designing-reports/organizing-data/grouping-data) -- [Custom Functions in Telerik Reporting](https://docs.telerik.com/reporting/designing-reports/expressing-data/custom-functions) - - +* [Page Functions Explained - Telerik Reporting]({%slug telerikreporting/designing-reports/connecting-to-data/expressions/expressions-reference/functions/page-functions%}) +* [Grouping Data]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/grouping-data/overview%}) +* [Adding Groups to Report]({%slug telerikreporting/designing-reports/connecting-to-data/data-items/grouping-data/how-to-add-groups-to-report%}) From 5e1b45785c442417da5d37012291442756f2024b Mon Sep 17 00:00:00 2001 From: Todor Arabadzhiev Date: Mon, 15 Sep 2025 17:02:45 +0300 Subject: [PATCH 3/3] Update group-specific-page-numbering-telerik-reporting.md --- .../group-specific-page-numbering-telerik-reporting.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/knowledge-base/group-specific-page-numbering-telerik-reporting.md b/knowledge-base/group-specific-page-numbering-telerik-reporting.md index 53885e856..b473a5368 100644 --- a/knowledge-base/group-specific-page-numbering-telerik-reporting.md +++ b/knowledge-base/group-specific-page-numbering-telerik-reporting.md @@ -11,16 +11,13 @@ ticketid: 1698535 --- ## Environment + - - - -
Product Reporting
Version 19.1.25.521
@@ -33,14 +30,13 @@ I need page numbering based on a specific group using Standalone Designer. Inste To implement group-specific page numbering, follow these steps: ### Using Built-in Page Functions + 1. Open the report in the Standalone Designer. 1. Define a group for the desired field (e.g., `ResidentID`) at the report level if not already done. 1. Add a TextBox to the page footer. 1. Use the following expression to display page numbering within the group: - ``` - ="Page " + PageNumber("residentGroup", Fields.ResidentID) + " of " + PageCount("residentGroup", Fields.ResidentID) - ``` + `= "Page " + PageNumber("residentGroup", Fields.ResidentID) + " of " + PageCount("residentGroup", Fields.ResidentID)` - Replace `"residentGroup"` with your group's name. - Replace `Fields.ResidentID` with the key field of the group.