Group Header OnPage with Continued Label

Posted by: jallen on 5 December 2024, 2:53 pm EST

    • Post Options:
    • Link

    Posted 5 December 2024, 2:53 pm EST

    I am using Active Reports 17 to create a code-based section report.

    I have a GroupHeader section with RepeatStyle = OnPage so that when a group contains many details across several pages we see the group’s name at the top of each page.

    I would like to add a Label beside the GroupHeader’s TextBox to display “Continued” but only on subsequent pages, not on the first page that the group name was displayed.

    For example:

    Group A

    -----Detail 1

    -----Detail 2

    -----Detail 3

    -----Detail 4

    Group B

    -----Detail 5

    -----Detail 6

    -----Detail 7

    -----Detail 8

    [New Page]

    Group B (Continued)

    -----Detail 9

    -----Detail 10

    -----Detail 11

    -----Detail 12

    Is there a way to make this happen?

    John

  • Posted 6 December 2024, 1:41 am EST

    Hi John,

    Yes, you can show the “Continued” label on the GroupHeader only on subsequent pages after the first page where the group appears.

    This can be done by tracking the page number where the group header was last printed (using the variable (here groupLastPageNumber). Initially, this variable is set to 0, meaning no page has been printed yet. During the GroupHeader’s Format event, the current page number is compared with groupLastPageNumber. If the current page is greater than the last page printed for the group (i.e., a new page after the first), the “Continued” label is made visible. Otherwise, the label is hidden. This ensures the label only appears after the first page of each group. The groupLastPageNumber is updated each time the Detail section’s Format event is triggered by retrieving the current page number using

    this.PageNumber
    .

    You may also refer to the attached sample and it’s generated output for reference.

    We hope this helps!

    Attachments:GroupOutput.zipGroupHeaderSample.zip

  • Posted 11 December 2024, 10:15 am EST

    Thanks!

  • Posted 10 January 2025, 4:02 pm EST

    Unfortunately, after more testing, I see a problem with this solution. If the very last item printed on a page is the last detail row of the group, the Detail_Format event fires and sets GroupPageLastNumber = Me.PageNumber.

    Then when the GroupHeader1_Format event fires for the next group on the next page, the CurrentPageNumber > GroupPageLastNumber and the continued label is shown, even though this is the first time this group has been displayed.

    Is there any additional logic we can add to overcome this?

    John

  • Posted 13 January 2025, 2:51 am EST

    Hi John,

    Can you show us where this issue is occurring by updating our previously shared sample so that we can have a look into the issue and assist you accordingly, as currently we can’t replicate the issue at our end?

  • Posted 13 January 2025, 9:56 am EST

    I have attached a report written in vb that demonstrates the problem. The data must have the last detail in a group as the very last item in the page. Refer to group #9.SectionReport1.zip

  • Posted 13 January 2025, 9:59 am EST

    I have also attached another approach, where we just save the last group header so we know if that group has been displayed. This seems to work so far in my testing.SectionReport1 (2).zip

  • Posted 14 January 2025, 1:06 am EST

    Hi John,

    Your solution seems to effectively handle the “Continued” label scenario, even for edge cases where a group ends exactly at the bottom of a page.

    Your approach to comparing the LastGroupHeader with the current group header value works well to determine whether the “Continued” label should be shown.

    If you encounter any additional scenarios or have further questions, feel free to reach out.

  • Posted 14 January 2025, 8:59 am EST

    Thanks!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels