Group PageNumber / PageCount

29 posts, 0 answers
  1. Scott Ponder
    Scott Ponder avatar
    8 posts
    Member since:
    Mar 2007

    Posted 26 Jun 2007 Link to this post

    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
  2. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 27 Jun 2007 Link to this post

    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
  3. Scott Ponder
    Scott Ponder avatar
    8 posts
    Member since:
    Mar 2007

    Posted 27 Jun 2007 Link to this post

    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)
  4. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 28 Jun 2007 Link to this post

    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
  5. Scott Ponder
    Scott Ponder avatar
    8 posts
    Member since:
    Mar 2007

    Posted 28 Jun 2007 Link to this post

    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
  6. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 28 Jun 2007 Link to this post

    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
  7. John
    John avatar
    13 posts
    Member since:
    Jul 2008

    Posted 04 Sep 2008 Link to this post

    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?
  8. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 05 Sep 2008 Link to this post

    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.
  9. James
    James avatar
    46 posts
    Member since:
    Oct 2008

    Posted 10 Nov 2008 Link to this post

    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!

  10. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Nov 2008 Link to this post

    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.
  11. Francisco
    Francisco avatar
    7 posts
    Member since:
    Aug 2008

    Posted 31 Jul 2009 Link to this post

    Hi,

    you have prevision (time) to this feature??

    reguards,
    Gio
  12. Bill
    Bill avatar
    5 posts
    Member since:
    Jul 2010

    Posted 31 Aug 2010 Link to this post

    Hi,

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

    Thanks,
    James
  13. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 01 Sep 2010 Link to this post

    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
  14. Massimiliano
    Massimiliano  avatar
    1 posts
    Member since:
    Nov 2008

    Posted 04 May 2011 Link to this post

    Hi,

    Is this feature implemented in  2011 Q1 release?

    Thanks,
    Pierluigi
  15. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 05 May 2011 Link to this post

    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
  16. Michael Weiss
    Michael Weiss avatar
    6 posts
    Member since:
    Jun 2006

    Posted 01 Mar 2012 Link to this post

    Hello
    Has this feature been added yet? This would be a real life saver!
    Thank you,
    Michael
  17. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 01 Mar 2012 Link to this post

    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.
  18. Michael Weiss
    Michael Weiss avatar
    6 posts
    Member since:
    Jun 2006

    Posted 01 Mar 2012 Link to this post

    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
  19. Aaron Abdis
    Aaron Abdis avatar
    26 posts
    Member since:
    Mar 2005

    Posted 13 Apr 2012 Link to this post

    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!  :)
  20. Tim
    Tim avatar
    3 posts
    Member since:
    Feb 2012

    Posted 11 Mar 2014 in reply to Steve Link to this post

    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?
  21. Tim
    Tim avatar
    3 posts
    Member since:
    Feb 2012

    Posted 12 Mar 2014 in reply to Tim Link to this post

    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.
  22. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 14 Mar 2014 Link to this post

    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.

     
  23. Bob Mills
    Bob Mills avatar
    28 posts
    Member since:
    Aug 2009

    Posted 29 May 2014 in reply to Nasko Link to this post

    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











  24. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 03 Jun 2014 Link to this post

    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.

     
  25. Bob Mills
    Bob Mills avatar
    28 posts
    Member since:
    Aug 2009

    Posted 03 Jun 2014 in reply to Nasko Link to this post

    Thanks! it worked.
  26. Mark
    Mark avatar
    118 posts
    Member since:
    Oct 2014

    Posted 04 Dec 2014 Link to this post

    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.
  27. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 09 Dec 2014 Link to this post

    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.

     
  28. Ingo
    Ingo avatar
    1 posts
    Member since:
    Feb 2012

    Posted 06 Mar 2015 in reply to Nasko Link to this post

    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.)
  29. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 10 Mar 2015 Link to this post

    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.

     
Back to Top