Issue with inserting page(s)

Posted by: p.feenstra on 19 January 2022, 9:57 pm EST

  • Posted 19 January 2022, 9:57 pm EST


    Using AR15 SectionReports
    Inserting or adding a page programmatically no longer works and results in an error.
    My previous AR10 did not have any problems with that.
    Am I missing a reference or have I found a bug again?

    Regards Piet
  • Replied 23 January 2022, 4:17 am EST


    Invested a little more time in the problem.
    It seems that AR15 does not recognizes a report as an object anymore. AR10 does.
    But luckily it does recognize a PagesCollection as an object.
    So with a workaround it could be fixed.

    This bug will be easy to fix for the developers. (I hope they do)

    Regards Piet
  • Marked as Answer

    Replied 23 January 2022, 10:32 pm EST


    To insert a new page within a report in Active Reports 15, you may use the Pages property and may insert a new instance of Page Class within the ReportEnd event to implement the same. Please refer to the below code snippet:

    private void SectionReport1_ReportEnd(object sender, EventArgs e)
    var pageCount = this.Document.Pages.Count;
    this.Document.Pages.Insert(pageCount , new GrapeCity.ActiveReports.Document.Section.Page());

    Please refer to the sample attached below.

    Dushyant Sharma
Need extra support?

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

Learn More

Forum Channels