I have a DLL with a report. When I go from design mode to preview in VS the report constructor is executed and it does what's required.
Using the stand-alone designer I import the DLL, and on initial creation the constructor is invoked - twice actually. But from then forward, it's never invoked on preview or at any other time.
I created a Windows Form with a report viewer, set the ReportSource to the TRDX via a URL/file reference. Same thing - ODS is called but the report constructor is never invoked.
I'm using the ODS only to retrieve design-time schema. At run-time I'm using report parameters to determine what data to return, and the ODS is invoked manually from NeedDataSource. Someone might think I need to set the ODS to null in the constructor. Again, the constructor is not being called.
The stand-alone designer does show my class name "ReportTemplate" in the Property Browser. So I know it found that class. My report has the ODS pre-loaded, and when the designer first opens that ODS is there, obviously coming from execution of the InitializeConstructor() method, executed from my constructor. So On initial creation it finds what it needs in that class.
From the report viewer, the interactive mode does display a text box that was placed for the header. So it seems InitializeComponent() is getting executed for that report, but nothing else. This is very confusing. It's almost like the report base class is getting executed but not my derived class - and once a report is imported, the derived class isn't invoked anymore. Or perhaps I just don't know what setting to check to get it to instantiate my report class at run-time. Maybe it's a namespace issue and at run-time it can't find my report class within my namespace.
Side note: Originally the interactive mode did not display that report header, but going to preview mode it did. My ODS is returning a DataTable with columns defined and no rows. When I changed that to return a single row of null column data, interactive mode started to show the header too - it's like a null DataSource causes one mode to not render anything but it's different in the other mode. I dunno if anyone would call that a bug but it's certainly slightly anomalous behavior.
Thanks.
Using the stand-alone designer I import the DLL, and on initial creation the constructor is invoked - twice actually. But from then forward, it's never invoked on preview or at any other time.
I created a Windows Form with a report viewer, set the ReportSource to the TRDX via a URL/file reference. Same thing - ODS is called but the report constructor is never invoked.
I'm using the ODS only to retrieve design-time schema. At run-time I'm using report parameters to determine what data to return, and the ODS is invoked manually from NeedDataSource. Someone might think I need to set the ODS to null in the constructor. Again, the constructor is not being called.
The stand-alone designer does show my class name "ReportTemplate" in the Property Browser. So I know it found that class. My report has the ODS pre-loaded, and when the designer first opens that ODS is there, obviously coming from execution of the InitializeConstructor() method, executed from my constructor. So On initial creation it finds what it needs in that class.
From the report viewer, the interactive mode does display a text box that was placed for the header. So it seems InitializeComponent() is getting executed for that report, but nothing else. This is very confusing. It's almost like the report base class is getting executed but not my derived class - and once a report is imported, the derived class isn't invoked anymore. Or perhaps I just don't know what setting to check to get it to instantiate my report class at run-time. Maybe it's a namespace issue and at run-time it can't find my report class within my namespace.
Side note: Originally the interactive mode did not display that report header, but going to preview mode it did. My ODS is returning a DataTable with columns defined and no rows. When I changed that to return a single row of null column data, interactive mode started to show the header too - it's like a null DataSource causes one mode to not render anything but it's different in the other mode. I dunno if anyone would call that a bug but it's certainly slightly anomalous behavior.
Thanks.