Many organizations require to have Reporting that can be accessed online. There are many options on the web including SQL Server Reporting Service (SSRS) and Asp.Net ReportViewer Control.
If you install SSRS in server then the server becomes Report Server. SSRS makes easy on report development also deployment. After developer creates report he can deploy it to Report Server so users can view that report by browsing to Report Server Url.
On the other hand, ReportViewer Control is more flexible. It is built on Asp.Net and Reporting by ReportViewer doesn’t need to have SQL Server if you don’t want to install it. Also client validation is not an issue anymore. Asp.Net has many techniques to do validation before Data Source is sent to ReportViewer.
This blog post will focus on applying ReportViewer Ver. 10. I use VS Web Developer 2010 Express and did some steps below before coding:
- Get ReportViewer Control Ver.10 from this link http://www.microsoft.com/en-us/download/details.aspx?id=6442 and install it
That component will be registered on C:\Windows\assembly folder after install.
- Using xcopy command, copy lib file which is Microsoft.ReportViewer.WebForms.dll from folder C:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\10.0.0.0__b03f5f7f11d50a3a to your own folder
- Create New Asp.Net Empty Web App Project
- Add reference to copied Microsoft.ReportViewer.WebForms.dll previously
- Add ReportViewer Ver.10 Control to your toolbox list
- Open Web.Config file. Make sure ReportViewer Version is 10.0.0.0 and add <httpHandlers> tag. Below is my web.config file:
<configuration> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="Microsoft.Build.Framework, Version=126.96.36.199, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Management, Version=188.8.131.52, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation> <httpHandlers> <add verb="*" path="Reserved.ReportViewerWebControl.axd" type = "Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </httpHandlers> </system.web> </configuration>