Monthly Archives: May 2015

Applying ReportViewer Ver. 10 (RDLC) in Asp.Net and using Visual Web Developer 2010 Express Edition

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.
The lack of SSRS is the SSRS service needs to be installed on top of SQL Server so that organization must manage their SQL Server and SSRS even if your main database is not using SQL Server. Cient validation is also often being issue since developer can not use javascript in Report Designer.

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:

  1. 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.
  2. 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
  3. Create New Asp.Net Empty Web App Project
  4. Add reference to copied Microsoft.ReportViewer.WebForms.dll previously
  5. Add ReportViewer Ver.10 Control to your toolbox list
  6. 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=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    				<add assembly="System.Management, Version=4.0.0.0, 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>
    

Continue reading