Active Reports v9 - Insert Blank Page At Beginning of New Group

Posted by: jmalda on 10 December 2018, 4:59 pm EST

    • Post Options:
    • Link

    Posted 10 December 2018, 4:59 pm EST

    Hello everyone,

    We have created a report that is grouped by a particular piece of data. We’ll call this group “Category”. Each Category is set to start on a new page. Each Category can have one more many details. So far, so good.

    However, we would like the first page of each Category to always start on an even page (2, 4, 6,… 100 etc) as opposed to an odd page (1, 3, 5, 103 etc). We are able to do the following in the GroupHeader BeforePrint event:

    • detect when the Group changes
    • determine if the current page is even or odd.

    However, we are unable to figure out how to inject a blank page if the new Category is set to start on an odd page. Anyone have any ideas?

    Thanks for your help.

  • Posted 11 December 2018, 4:28 am EST

    Hello,

    Please add the “PageBreak” in the Group header with the following code in the script section.

    
    public void Detail_BeforePrint()
    {
    	if(rpt.PageNumber % 2 == 0)
    	{
    		this.PageBreak1.Enabled = true;
    	}
    	else
    	{
    		this.PageBreak1.Enabled = false;
    	}
    }
    
    
    
    

    Also, Please refer to the attached report for complete implementation.

    Thanks.

    test.zip

  • Posted 11 December 2018, 1:24 pm EST - Updated 30 September 2022, 5:55 pm EST

    Hi there,

    Thank you for the reply. Unfortunately your solution does not seem to work for me. Even if I place a PageBreak control in the Group Header, make sure it is enabled, and have no code to enable or disable it, I do not get a page break.

    Below is page 1 of my report. The PageBreak control is in the Group Header where you see “Ferns” displayed. I would expect, with the setup outlined in the paragraph above that I would have an empty page, and that this page would be page 2 of the report.

    Page 4 of the report.

    Page 5 of the report, which I would expect to be Page 6 as we start a new Group “Grasses”.

    This is a multi column report…perhaps that affects the page breaks? Any ideas?

    Thanks for your help.

  • Posted 12 December 2018, 1:57 am EST

    Hello,

    I get the different result with the different layout of the report. Could you please send your report with DB so that I can find a suitable solution for your report.

    Thanks.

Need extra support?

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

Learn More

Forum Channels