Friday, August 06, 2004

Reports suck!

Its been some time since I blogged, off late life has been a little hectic..have got lotsa work in the office & things haven't been going all that well at personal front either. anywez, just yesterday got work to do on 8 reports, these are basically existing reports done in ASP & COM, my job is to port them to .net as the db schema has changed so most of the existing reports don't run properly anyway. The current architecture is that the report output is sent to the user via email & the report is never shown on the web. So basically a user selects the criteria & hits submit, the ASP page creates a row in a database table & another component polls that table(this component is not running off the web server) & invokes a com component based on the report that the user selected & executes a particular method on that component(all the reports implement one interface). Since most of the reports have nearly the same search criteria, what I did was that I created a user control for the filter criteria & all the reports include this user control. The user control exposes some public properties which can be set by the hosting page to enable/disable validation controls, show/hide controls etc. as there is slight differences between the reports' filter criteria, for e.g. reportA defines controlA to be mandatory but for reportB, controlA is not mandatory etc. The other thing that I have done is that every report inherits from a custom class called Reports which inherit from UI.Page, the base class has a method called SaveReport which iterates through all the controls on the page & creates a XML parameter list. Every report calls SaveReport which after serializing the controls, saves it to the report table. This way I avoided having to write logic/code for all the reports to insert into the DB. I know this is not the best solution but given the time lines, this is the best that I could think off!!

No comments:

Post a Comment