This is a migrated thread and some comments may be shown as answers.

Group PageNumber / PageCount

32 Answers 704 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Scott Ponder
Top achievements
Rank 1
Scott Ponder asked on 26 Jun 2007, 08:24 PM
Does anyone know how to add a group page count and group page number to a report?  I know how to get the global page count, but I need a pageCount and PageNumber for each group

32 Answers, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 27 Jun 2007, 03:25 PM
Hi Scott Ponder,

Currently you can use PageHeader and PageCount global objects only in the PageHeader/Footer Sections as both are available when the report is being rendered, but not earlier.

Can you give us some additional details on "pageCount and PageNumber for each group"? How do you plan to use the page count and number in the group? We may be able to provide you with a workaround of some sort once we understand your requirements.

 
Best wishes,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott Ponder
Top achievements
Rank 1
answered on 27 Jun 2007, 03:30 PM
I need to have each group to report its own set of page numbers, ie. group page 1 of 2, (eventhough PageNumber mught be 25 and PageCount might be 150)
0
Svetoslav
Telerik team
answered on 28 Jun 2007, 10:27 AM
Hello Scott,

Thank you for the additional details. Indeed, our tool does not support this out of the box.

We spent some time to look for similar scenarios with other reporting tools and we came over a blog post that seems closest to your case: http://blogs.msdn.com/chrishays/archive/2006/01/05/ResetPageNumberOnGroup.aspx. We'll highly appreciate if you can take a look at it and confirm that this is what you need.

 
Greetings,
Svetoslav
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Scott Ponder
Top achievements
Rank 1
answered on 28 Jun 2007, 12:11 PM
Thank you for taking time to look into this.  Yes, this blog is very close to what I would like to be able to do on my report, the only other thing I would like to be able to do is to have a group pageCount, so that I can print 1 of 2 or 2 of 2 etc. on each page of the group, preferably in either the group footer or the page footer.

BTY I am very pleased with this product
0
Vassil Petev
Telerik team
answered on 28 Jun 2007, 02:40 PM
Thank you for the nice words, Scott!

Yes, we will add this feature in our ToDo list for the next major version. For your information, we add new features based on the number of requests we get for each. So, the higher the interest in group page numbers, the higher the chances that we may introduce it sooner :)

Feel free to share your further feedback on Telerik Reporting.


Kind regards,
Rob
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 04 Sep 2008, 04:10 PM
Telerik,

In this post, you mention that page information is calculated AFTER the page is rendered. I am trying to do the same thing Scott is trying to below. My question is this, if I use the code-behind event to do my grouping of pages, can I display that information on the report? For example:

Say the report is 10 pages with 4 separate groups, I want to print the following on the different pages of the report:

page 1 of 3
page 2 of 3
page 3 of 3

page 1 of 4
page 2 of 4
page 3 of 4
page 4 of 4

page 1 of 1

page 1 of 2
page 2 of 2


Note, there are 10 pages printed, but the page number is displayed by group.

If I can trap the event and decide those values, then all my troubles would be solved.

Thoughts?
0
Steve
Telerik team
answered on 05 Sep 2008, 03:50 PM
Hi John,

Unfortunately such functionality is still not available in our Reporting offering. However we have not given up on the idea and would continue our investigation on the matter.

Regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
James
Top achievements
Rank 2
answered on 10 Nov 2008, 02:08 PM

It was mentioned that this would be added to the TODO list on June 28, 2007, so I wanted to follow-up and see if this has been done, and if it is in the current release?

 

Thanks!

0
Steve
Telerik team
answered on 10 Nov 2008, 02:29 PM
Hi James,

We have not had the time to research and work on this feature. Please check our RoadMaps regularly for what is being worked on and what we might be working on. When this feature makes it in the RoadMap, you would know that we are at least researching on it.

All the best,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Francisco
Top achievements
Rank 1
answered on 31 Jul 2009, 04:25 PM
Hi,

you have prevision (time) to this feature??

reguards,
Gio
0
Bill
Top achievements
Rank 1
answered on 31 Aug 2010, 09:10 PM
Hi,

Have you implemented the feature yet? or does it already be included in the current version?

Thanks,
James
0
Steve
Telerik team
answered on 01 Sep 2010, 10:06 AM
Hi guys,

As you can verify from the release notes so far, we have not implemented it yet. I've raised the priority of the task, so hopefully we would be able to implement it for subsequent release.

Thank you all for the patience and understanding.

Kind regards,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Massimiliano
Top achievements
Rank 1
answered on 04 May 2011, 05:26 PM
Hi,

Is this feature implemented in  2011 Q1 release?

Thanks,
Pierluigi
0
Steve
Telerik team
answered on 05 May 2011, 03:13 PM
Hi guys,

There is no out of the box functionality yet, but one possible way to approach this inquiry is by creating separate report for each group, combine them into a Report Book and utilize the PageNumberingStyle Property to indicate whether the page numbering / count should start from 1 or continue from the last page number / count of the previous report.

All the best,
Steve
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Michael Weiss
Top achievements
Rank 1
answered on 01 Mar 2012, 02:49 PM
Hello
Has this feature been added yet? This would be a real life saver!
Thank you,
Michael
0
Steve
Telerik team
answered on 01 Mar 2012, 04:19 PM
Hi guys,

Yes there is now a way to reset the PageNumber per group and you can find more information and sample implementation in the Reset PageNumber per Report Group blog post.

Enjoy!

Regards,
Steve
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
0
Michael Weiss
Top achievements
Rank 1
answered on 01 Mar 2012, 04:46 PM
Thank you for your quick response. I should be able to add the ResetPageNumberPerGroup class to my report project and call the functions from any of the reports in the project correct? When I create that class in my project I get an error telling me "Error 1 The name 'InitializeComponent' does not exist in the current context C:\Report Projects\CHIEmployeeTrainingReports\CHIEmployeeTrainingReports\ResetPageNumberPerGroup.cs".
Do you know what I may be missing here?
Thank you,
Michael
0
Aaron Abdis
Top achievements
Rank 1
answered on 13 Apr 2012, 07:34 PM
Thank you for the code to implement this, however it is not really ideal, but simply a kludgey work-around.

Really what needs to be implemented is the Telerik.Reporting.Group object needs a property added PagingStyle which could be Continue or Reset.

If it is Continue, then it would function as now, with consecutive page numbering through the entire report.

If it is Reset, then the page number/count would be reset with each new group.

Reporting is painful enough as it is (with ANY tool), ... please make it easier, not harder, I implore you!  :)
0
Tim
Top achievements
Rank 1
answered on 11 Mar 2014, 08:41 PM
Perhaps this thread is still active even though it is old. I found the work-around for resetting the page number when a group changes to be helpful. However, a new twist has arisen. If the report is exported as a pdf, the page number picks up from the last page number shown in the viewer. For example, my report contains pages 1 - 10; when exported, the pdf shows the page numbers as 11 - 20. Is there a solution for this problem?
0
Tim
Top achievements
Rank 1
answered on 12 Mar 2014, 02:16 PM
Additional information on my previous post: This pdf export page numbers pick up where the report viewer left off only when the report contains a single item on which the page numbering reset is based.
0
Nasko
Telerik team
answered on 14 Mar 2014, 05:08 PM
Hello Tim,

Thank you for bringing this to our attention.

This behavior is expected since the current code compares the last group on the page with the current group. When you refresh a report with just a single group, or you export it to PDF, the code will always compare the same group to itself i.e. will add up to the current page number.

To avoid this you can pass the current report page number to the user function, so the page number based on the groups can be reset together with the report page number.

We modified the sample report and implemented the above suggestion. Please find the sample report definition in the attached file.

Regards,
Nasko
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
0
Bob Mills
Top achievements
Rank 2
answered on 29 May 2014, 09:48 PM
We are also experiencing the issue of pagenumber changing when exported to pdf .Report shows page 1 of group1 in report VIewer but after it is  exported to PDF. it display this as  page number.2 in the pdf instead of 1.

Following is the code which rest the pagenumber as per group it. I downloaded modified code also to fix this pdf changing pagenumber issue but it is not clear that how getpage function will be incorporated with existing function. Following is existing code
Public Function MyPageNumber(lastGroupOnPage As String) As Integer
        If currentGroup <> lastGroupOnPage Then
            ResetPageNumbering(lastGroupOnPage)
        Else
            NextPageNumber()
        End If
        Return currentPageNumber
    End Function
    Private Sub ResetPageNumbering(lastGroupOnPage As String)
        currentPageNumber = 1
        currentGroup = lastGroupOnPage
    End Sub
    Private Sub NextPageNumber()
        currentPageNumber = currentPageNumber + 1
    End Sub











0
Nasko
Telerik team
answered on 03 Jun 2014, 11:29 AM
Hello Bob Mills,

You need to add a check for the actual page number when resetting the page number per group. Here is the whole report code including the modification fixing the issue:
Imports Telerik.Reporting
Namespace Telerik.Reporting.Examples.CSharp
 
    ''' <summary>
    ''' Summary description for PageNumberTestReport.
    ''' </summary>
    Public Partial Class ResetPageNumberPerGroup
        Inherits Telerik.Reporting.Report
        Public Sub New()
            '
            ' Required for telerik Reporting designer support
            '
 
                '
                ' TODO: Add any constructor code after InitializeComponent call
                '
            InitializeComponent()
        End Sub
 
        Private currentPageNumber As Integer
        Private currentGroup As String
 
        Public Function MyPageNumber(lastGroupOnPage As String, reportPageNumber As Integer) As Integer
            If lastGroupOnPage Is Nothing Then
                Return Me.currentPageNumber
            End If
 
            If Me.currentGroup <> lastGroupOnPage OrElse reportPageNumber = 1 Then
                Me.ResetPageNumbering(lastGroupOnPage)
            Else
                Me.NextPageNumber()
            End If
 
            Return Me.currentPageNumber
        End Function
 
        Private Sub ResetPageNumbering(lastGroupOnPage As String)
            Me.currentPageNumber = 1
            Me.currentGroup = lastGroupOnPage
        End Sub
 
        Private Sub NextPageNumber()
            Me.currentPageNumber += 1
        End Sub
    End Class
End Namespace


Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Bob Mills
Top achievements
Rank 2
answered on 03 Jun 2014, 09:30 PM
Thanks! it worked.
0
Mark
Top achievements
Rank 2
Veteran
answered on 04 Dec 2014, 03:55 PM
Ok, this works, except for, if you have a FOOT BAND for the grouping and you want that FOOTER BAND to print on its own page, the PAGE NUMBER for the FOOT BAND does not get incremented. Also, I am trying to get the TOTAL pages in the Group to show up in the FOOTER BAND, with out any luck.
0
Nasko
Telerik team
answered on 09 Dec 2014, 10:58 AM
Hello Mark,

We replied to your question in your support ticket on the same topic. Let's continue the discussion on your specific scenario there.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ingo
Top achievements
Rank 1
answered on 06 Mar 2015, 06:39 AM
If there's a solution presented in Marks support ticket, I'd appreciate it to be explained here as it might be fitting to our problem too. We're having serious trouble with paging while migrating from Crystal Reports to Telerik. With CR the PageNumber is available in every scope (group, detail, page, report); the limitations with Telerik's product especially in this regard sadly cause us much trouble.
(What we're trying to achieve is: each record of the underlying Datasource creates multiple pages of output (actually invoices); sometimes an even number of pages, sometimes odd. If odd, we want to add a pagebreak, so duplex printing of the finished output works w/o the first page of the next record printing on the back of the one before). As we can't access the current PageNumber in group or detail scope, we can't check for it and decide to make a PageBreak. In page scope, we know the PageNumber - but can't perform a PageBreak anymore. The "Reset PageNumber per Report Group" stuff doesn't help here, as this "custom" PageNumber isn't resolved after all the group/detail content is already done.)
0
Nasko
Telerik team
answered on 10 Mar 2015, 03:58 PM
Hello Ingo,

You are correct. The total page count cannot be retrieved in the group footer section due to how the report engine is designed and how it works. It is not possible to achieve this and this is described in the Report Structure help article.
You can use the PageCount or PageNumber global objects in a TextBox with expressions such as:

= PageCount

However, this expression will be valid only inside the Page Header/Footer. It is not possible to get it to show up in the Group Footer.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Ted
Top achievements
Rank 2
answered on 17 Oct 2019, 05:36 AM

How to Implement Reset PageCount per Report Group, like extended custom user functions "MyPageCount" ?

we use Telerik Report 2016 R3.

0
Neli
Telerik team
answered on 21 Oct 2019, 03:07 PM

Hello Ted,

I noticed that you have asked the same question in another forum post - Group Page Counter (x of y). You may find my answer there. Let's continue our discussion there.

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
0
venkat
Top achievements
Rank 1
answered on 10 Sep 2020, 10:51 AM

if the group have more records then page number 1 is repeating for group second page also..

means in the 3rd page i have group1  it is printing page numer as :1 it is fine..but next page of same group is showing page number as again 1 .. after showing again 1 next page is showing as 2 it means third page showing page numer as 2 and 4th page showing as page numer :3  like this...

0
Neli
Telerik team
answered on 15 Sep 2020, 08:56 AM

Hello Venkat,

Can you send us the report, so we can check on our end if we can improve the current outcome? Also, maybe you can send us a screenshot of the desired result.

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Scott Ponder
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Scott Ponder
Top achievements
Rank 1
Vassil Petev
Telerik team
John
Top achievements
Rank 1
Steve
Telerik team
James
Top achievements
Rank 2
Francisco
Top achievements
Rank 1
Bill
Top achievements
Rank 1
Massimiliano
Top achievements
Rank 1
Michael Weiss
Top achievements
Rank 1
Aaron Abdis
Top achievements
Rank 1
Tim
Top achievements
Rank 1
Nasko
Telerik team
Bob Mills
Top achievements
Rank 2
Mark
Top achievements
Rank 2
Veteran
Ingo
Top achievements
Rank 1
Ted
Top achievements
Rank 2
Neli
Telerik team
venkat
Top achievements
Rank 1
Share this question
or