Changing Group Header/Footer Priority during run-time

Posted by: knesom on 12 August 2024, 4:10 pm EST

    • Post Options:
    • Link

    Posted 12 August 2024, 4:10 pm EST

    Hello,

    I have 2 note reports that are very similar in layout but the order in printing them is the difference. For example, in the first report, the entire report is printed in Account # order and then by Note Type. Conversely, the second report is printed by Note Type first and then broken down by Account #. I’d like to swap the order of the groups with in the report, once I know the Print Order the user selected. This would save me writing 2 reports for the same data.

    I could I guess just add both an acct # and a note type to both group headers and do a show or hide based on the order chosen but wondered if there is already a built in property that will allow me to do this. :slight_smile:

    Thanks!

  • Posted 13 August 2024, 3:31 am EST

    Hi Kelly,

    It would be difficult to comment on the issue without actually looking into your sample reports replicating the issue. Could you please try providing us with sample reports with sample data replicating the issue so that we can investigate the same at our end and get back to you accordingly?

  • Posted 13 August 2024, 10:14 am EST

    I don’t have an issue, I’m just trying to change the order of the group header/footer and wondered if there was a property that can do that at runtime.

  • Posted 13 August 2024, 11:13 pm EST

    Hi Kelly,

    AFAIK, you cannot change the order of the groups at runtime. You can do so at design time by using the Reorder Groups option in the designer. Please refer to the attached screenshare video demonstrating the same.

    ReorderGroups.zip

  • Posted 14 August 2024, 5:29 pm EST

    Actually, I was able to figure out how to change the priorities of the group headers at run time by copying the code in the .designer file. So it went from this:

    Me.Sections.Add(Me.ReportHeader)

    Me.Sections.Add(Me.PageHeader)

    Me.Sections.Add(Me.AccountNumber_GroupHeader)

    Me.Sections.Add(Me.NoteType_GroupHeader)


    Me.Sections.Add(Me.Detail)

    Me.Sections.Add(Me.NoteType_GroupFooter)

    Me.Sections.Add(Me.AccountNumber_GroupFooter)


    Me.Sections.Add(Me.PageFooter)

    Me.Sections.Add(Me.ReportFooter)

    to:

    Sections.Clear()

    Me.Sections.Add(Me.ReportHeader)

    Me.Sections.Add(Me.PageHeader)

    Me.Sections.Add(Me.NoteType_GroupHeader)

    Me.Sections.Add(Me.AccountNumber_GroupHeader)


    Me.Sections.Add(Me.Detail)

    Me.Sections.Add(Me.AccountNumber_GroupFooter)

    Me.Sections.Add(Me.NoteType_GroupFooter)


    Me.Sections.Add(Me.PageFooter)

    Me.Sections.Add(Me.ReportFooter)

    The swap in priority needed to be hand coded in the ReportStart Event.

  • Posted 16 August 2024, 12:05 am EST

    Hi Kelly,

    Yes, you can change the order in which the sections are added to the report. We are glad that your requirement has been fulfilled!

Need extra support?

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

Learn More

Forum Channels