Fields are all null unless I populate one of them first

Posted by: mschmitz on 6 October 2017, 4:59 pm EST

  • Posted 6 October 2017, 4:59 pm EST

    Hello this is an issue I’ve been having where all the fields are null in the “before print” event of a detailed section of a report. The datasource is being set at runtime. If I manually set one of the fields myself in the datainitializate event then all 11 fields are populated in the fieldcollection correctly. The screenshot below shows how all the fields exist in the first pass of the “before print” event. (all null unless I set one of them in the datainitialize event)

  • Posted 10 October 2017, 11:04 am EST

    ok I figured it out I think. The documentation says not to try to access the field collection in the section events, only in the datainitialization and fetchdata events. Once I moved all the code from the beforeprint event to the fetchdata event I stopped having problems.

  • Posted 11 October 2017, 7:07 am EST

    Hello,

    BeforePrint event is used to make the page/layout settings. You should always use the FetchData or DataInitialize events to refer the Fields collection in code.

    Thanks,

    Deepak Sharma

Need extra support?

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

Learn More

Forum Channels