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!

Need extra support?

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

Learn More

Forum Channels