We have developed a Basic SSRS Report Chapter-1, and deployed the report to our reporting server in Chapter-2 now we can call the same through the client application. In this section, we will use Asp.net as the client application for calling the report, I am using VS 2010 for the purpose you may use 2010 or any higher version. The steps to do so are.
Step 1: Open Visual Studio. From File menu, choose New->Website. And from the available templates, choose ASP.Net Web site. And click OK button.
Step2: Create a web form CallSSRS.aspx and drag and drop the below controls into the designer layout from toolbox.One ScriptManager control, One Button control and One ReportViewer control.
Step-3: The page will look like
Step 4: Double click on the button and add the below code in the code behind of the Button click event
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
ReportViewer1.ShowParameterPrompts = False
ReportViewer1.ShowCredentialPrompts = False
Dim paracity As New ReportParameter(“city”, “London”)
ReportViewer1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
ReportViewer1.ServerReport.ReportServerUrl = New Uri(“http://akanksha/ReportServer”)
ReportViewer1.ServerReport.ReportPath = “/BasicSSRS1/ReportSSRS1”
Catch ex As Exception
Note: Please import Imports Microsoft.Reporting.WebForms on the code page as given in the image
Our report is located at “/BasicSSRS1/ReportSSRS1 path in the server, for this information we can click URIs present in the Report Manger URL of Reporting Services Configuration Manager.
“ReportServerUrl” is the location where your SQL Server Reporting Services is running your can find the value of this parameter from the Report configuration manager as shown below.
While typing in the value of ReportServerUrl in the button script avoid the port 80 as 80 is default port of IIS so need not to be mention in code, so the url will be
On clicking the ReportServerUrl the screen below will appear which gives you the value of ReportPath which indicates the path where our report is deployed.
Note: For running the ASP Project calling the SSRS report you may enable Google Chrome as default browser to avoid any script error initially, it will be explain in letter chapters how to deal with scripts debug of Internet Explorer.
Upon clicking BasicSSRS1 link we can open all the report deployed under the project and can open ReportSSRS1.rdl as shown in the image given below
So, in this section we understand how to call SSRS Report with parameter from client application i.e asp.net application.
Previous Related Post:
Chapter-1: Creating a basic Tabular SSRS Report using Report Wizard
Chapter-2 : Report Deployment on SQL Server 2012 Reporting Server
Chapter-3:Opening/Calling the deployed SQL Server Reporting Server report from Asp.net