Showing posts with label Dynamic Reports in SQL Server Reporting Services 2008. Show all posts
Showing posts with label Dynamic Reports in SQL Server Reporting Services 2008. Show all posts

Saturday, July 4, 2009

Dynamic Reports in SQL Server Reporting Services 2008

Problem Summary:
My last assignment was on SQL Server Reporting Services 2008. I was given to create/export direclty (into excel or pdf format) reports from ASP.NET web interface basis the search criterias where number of the columns were not fixed; columns were supposed to come from the rows of queries.
Now prabibly a question tosses in your mind Why SSRS, not the traditional way of COM/office component to write excel file instead of exporting by SSRS things. The answer is to uniform the development/runtime environment with stronger .NET based things. and off course to implement security for report access with SSRS 2008. Also reports can be bind any time with Report Viewer Control.

So what I did:
1. Wrote stored procedure to result data passing the search criterias; off course lots of dynamic sql to make columns based on the rows in the query results for specific input parameters and then populating desired data to those columns based on the certain manipulations.
2. Generated memory stream of .rdl (Report definition language) based on the dynamic schema being resulted after executing the stored procedures created in the first step. It involves lots of C# code to write XML format of rdl formatting and binding the data elements to the report skeleton.
3. Exported report in the desired format(.xls/pdf etc.) using the compiled proxy class of the Report Server Web service Library (ReportingService2005.dll).

Yes It was really a challenging stuff recently I faced.
I would like to share with you in detail if you are doing the similar kind of stuff.

Cheers!!
Sudhir

Followers