Creating an SSRS report with dynamic columns
A couple years ago, I created a report in SQL Server Reporting Services that allowed the columns in the report to be configured dynamically to display different datapoints. The report allows the user to configure a parameter for each column to determine what datapoint is shown in that column. This approach is too unwieldy for a report accessed by the user directly, but can be handy if the report is distributed by a subscription. In this way, multiple users can get the same report configured to their needs. If you have a large number of users, this approach is much faster & more maintainable than creating separate reports for each one. Disclaimer, this was done in Visual Studio 2005 against a SQL Server 2005 DB so things may have changed a bit. First, I defined the SQL query. Notice that there are "Aggregation Type" columns returned which reference some of the actual data columns. This tells the report how to aggregate that particular column. So, for example if ...