I am currently using forms to capture input parameters within several reports I have made in a project at work. In addition I get the data for the report through a ReportService class in a self-made assembly. The service is registered as a BusinessObject. This is working great and I can in this way encapsulate the SQL within my assembly. Here is a simplified version of the input form Ok button click event:
Code: Select all
var service = this.Dictionary.BusinessObjects["MyReportService"].BusinessObjectValue as ReportService;
service.MyMethod(param1, param2, ...)
Because of some new requirements, I now need to be able to run these reports in the web viewer. I am able to transform most of the input parameters to variables (using 'Request from User'), but I am struggling with accessing the ReportService.
I have tried accessing the ReportService in the report constructor and the StiReport.BeginRenderEvent with no luck. It does not seem to be initialized at those points. It is however accessible from the input form Ok button click event.
I have attached a complete Visual Studio example of the issue (references to Stimulsoft-assemblies may need to be changed). I am using Stimulsoft Reports.Ultimate 2014.1.