C1FlexReport - Subreport for PageNo

Posted by: brezodejan on 27 December 2019, 6:38 pm EST

  • Posted 27 December 2019, 6:38 pm EST

    Hello guys,

    Is there way to create Subreport for displaying PageNo / PageCount
    I create one Subreport, and it doesn't work in C1FlexReport.
    I give this error:
    Error rendering report:
    Evaluate expression '': Object reference not set to an instance of an object

    It works in C1Report

    See example.

  • Replied 29 December 2019, 6:28 pm EST


    Please inform about your use-case for which you need this arrangement as you can directly display the page numbers in the PageFooter field of the report.
    Note that the "[Pages]" variable takes value after the report has been completely rendered. On using it in subreport, we are trying to fetch its value during the rendering of the report. As this variable has no value at this point, the error is observed.
    The suggested way is to directly use the PageCount related CalculatedField in the PageFooter of a report.

  • Replied 30 December 2019, 7:54 pm EST

    The use case is very simple. I want my subreport with page number to look the same in every report I use it, so when I modify the look of the page number in just one place (in that subreport) it is displayed the same way in every report that contains that subreport.
    I use that in many reports in C1Report, and now I have the problem how to migrate that part.
    And, if I use "[Page]" without "[Pages]" I get the warning message:
    Evaluate expression '': Object reference not set to an instance of an object
    But with warning it works.
  • Replied 1 January 2020, 4:37 pm EST


    On further investigation, it is observed that both [Page] and [Pages] can be used in the report to fetch correct page numbering. Just the warning is observed because of the reason previously mentioned. This is bound to be observed.

    Please refer the attached report wherein "Products Report" and "Test Report" are getting page numbers from the subreport, without any error.

  • Replied 1 January 2020, 7:03 pm EST

    Yes, you are right.
    But, if I set IgnoreScriptErrors = false, I get error (why error if it is a warning?) and my app stop to work (I got wrong [Pages] on every page).
    Is that something you expecting?
  • Replied 2 January 2020, 4:46 pm EST


    I understand that this is not a normal behavior of the reports and hence, I have escalated the same to the development team [Internal Tracking ID: 415248]. Will get back to you once I receive any information.

  • Marked as Answer

    Replied 17 March 2020, 9:59 pm EST


    I am glad to inform you that the issue has been fixed in the latest build (i.e. 2020v1). You can get it from the link below:

Need extra support?

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

Learn More

Forum Channels