Hide main report PageFooter during Subreport (AR 10)

Posted by: mdynna on 29 January 2019, 5:20 pm EST

    • Post Options:
    • Link

    Posted 29 January 2019, 5:20 pm EST

    We have a main report that prints one to many records for a Customer, and we want the Page Footer to display at the bottom, at that works just fine. After all records for a Customer are done printing, we active a subreport in the GroupFooter for that section. I would like the “main” report’s Page Footer to be “suppressed” while that subreport is being printed.

    I’ve tried experimenting with some flags set during the GroupFooter Format event and GroupFooter AfterPrint event. They work in that the Page Footer is not shown during the subreport. However, the subreport rolls onto additional pages (leaves space) as if the Page Footer was still visible.

    At what point can I set the Page Footer Visible = False and have the subreport use all available space on the page?

  • Posted 30 January 2019, 11:10 am EST

    Hello,

    In order to hide the PageFooter on selective pages, where the subreport (in GroupFooter) is rendered, you must set the PageFooter visbility to false in GroupFooter’s BeforePrint event and then set it to true in GroupHeader’s AfterPrint event in main report’s code, as follows:

    private void groupFooter1_BeforePrint(object sender, EventArgs e)
            {
                pageFooter.Visible = false;
            }
    
            private void groupHeader1_AfterPrint(object sender, EventArgs e)
            {
                pageFooter.Visible = true;
            } 
    

    This works correctly for us, without the subreport taking additional pages.

    Please refer the attached sample for your reference.

    The reports are bound to NWIND.mdb shipped with the product.

    Best Regards,

    Esha

    SectionReportApplication_Subreport.zip

Need extra support?

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

Learn More

Forum Channels