Currently reports work fine if everything is designed in the designer or if the full report is generated using code. However, we use design time reports which are extended at run time based on certain parameters. Two very basic use cases for this are:
1) Adding dynamic columns to a table
2) Adding a standard fixed header / footer to the report (with contents depending on the specific report instance)
The issue we have is that the report items we need to add to the report (header or extra columns) depend on data from the database.
It is possible (with a lot of restrictions and workarounds) to get the above working, but it would really make it a lot simpler if the following were available on the report class:
a) An event / virtual method which can be overridden in a base class which gets called after the design time definition of the report has been created (similar to form loaded in other applications).
b) A way to get access at runtime to the column definitions of the SqlDataSource linked to a table (if it is a Sql source).
Our current partial solution is to set the data source of the table at design time and design the table accordingly. In our report's constructor we clear the data source of the table. In the "need data source" event of the table we create a new data source in code (duplicating the parameters etc. which were already defined during the design), open the dataset, inspect the column list and add the table columns as required. (Actually we return two result sets, one of which is a list of columns to add as selected by the user).
1) Adding dynamic columns to a table
2) Adding a standard fixed header / footer to the report (with contents depending on the specific report instance)
The issue we have is that the report items we need to add to the report (header or extra columns) depend on data from the database.
It is possible (with a lot of restrictions and workarounds) to get the above working, but it would really make it a lot simpler if the following were available on the report class:
a) An event / virtual method which can be overridden in a base class which gets called after the design time definition of the report has been created (similar to form loaded in other applications).
b) A way to get access at runtime to the column definitions of the SqlDataSource linked to a table (if it is a Sql source).
Our current partial solution is to set the data source of the table at design time and design the table accordingly. In our report's constructor we clear the data source of the table. In the "need data source" event of the table we create a new data source in code (duplicating the parameters etc. which were already defined during the design), open the dataset, inspect the column list and add the table columns as required. (Actually we return two result sets, one of which is a list of columns to add as selected by the user).