I am trying to have a ReportHandler service to handle reporting. Reports can contain several different parameters that can be set. There are currently several different methods for creating reports in the system (MS report services, html reports, etc.) and a method for generating data for each report. I am trying to consolidate everything in ActiveReports. I cannot change the system and change the parameters, so in some cases I essentially get a where clause to generate the results, and in another case I get the key / value pairs that I have to use to generate the results. I was thinking about using the factory pattern, but due to the different number of query filters this will not work.
I would like to have one ReportHandler who will use my various materials and spit out the report. At the moment, I see no other way than using the large switch statement to process each report based on the name of the report. Any suggestions how I could solve this better?
source
share