I have a rapidly growing set of Telerik reports in my web project. My data providing strategy is that each report has an companying text file containing a SQL query. I handle complex filter criteria, like long 'x is in(y,z,a,b,c....)', or '((x=1) and (x < y))', repeated a hundred times, by doing text substitutions on a text file query before using it to get a DataTable for the report.
All reports are classes that derive from Telerik.Reporting.Report
, which have limited properties that serve as report meta-data, such as business title of the report, vs. the report's programmatic name. There are no fields for attributes such as a report category, the name of the SQL query file for the report, possible alternate viewing page for the report, the subset of common filter parameters to be disabled for the report, etc.
I find the first candidate solutions here unattractive, viz. creating and maintaining a 'report settings' store, either in a file, web.config, or a database table. This store is divorced from the actual reports, and working in them or the store requires frequent and annoying context swaps.
My more favoured idea is to use something similar to the Dynamic Data meta-data scheme, where an attribute on the entity class ascribes another class to hold meta-data for the entity. I could also extend Telerik.Reporting.Report
, adding maybe a dictionary for attributes I want to attach to reports, and derive all my reports from that.
Any criticism on my current thinking, or suggestions on other options, will be appreciated.