Steps to Integrate SSRS with ASP.Net Web Applications
Changes are exceptionally quick in web development world. In the earlier decade, there have been various new updates in programming like holding agile technique, adapting decoupled architecture and many more. Applications which we build today are not quite the same as the ones we worked when ASP.NET was at first considered. Today’s Web applications are more dynamic and are extensively less dependent on server-generated HTML. At the same time, they use rich client functionality that depends on services to gather information.
ASP.NET is a capable and well known web development framework. It is generally utilized as a part of enterprise website & product development. It has advanced altogether from web forms to MVC to Web API. In the meantime, web development world has tremendously rebuilt since the initial arrival of ASP.NET. In spite of being more effortless and easy to use for developers, ASP.Net still requires system framework to put extra time and effort to solve the configuration and variant issues.
SQL Server Reporting Services (SSRS) is server based report generator programming of Microsoft. It serves to make, send and administer reports using programming language like C# and Visual Basic. SSRS comes packaged with Microsoft SQL Server services. It gives massive advantage as far as decreasing the complexity for the reports which are amazingly tweaked and also are managing an expansive volume of information.
Below are the steps to integrate SSRS web service 2010 with the C# web application.
Make a Visual studio 2012 Web application for an instance MySSRSWebPortal.
Open “Developer command prompt for VS2012”,
Select the project root. For an instance: MySSRSWebPortalMySSRSWebPortal
Now generate the web proxy for report server 2010 use the wsdl command to make this proxy class (https://msdn.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx)
Implement below command:
wsdl /language:CS /n:”Microsoft.SqlServer.ReportingServices2010″ http://<Server Name>/ReportServer/reportservice2010.asmx?wsdl
Incase you get the following Error :
The request failed with HTTP status 401: Unauthorized.
It implies you are required to pass the validation parameter with the command:
wsdl /language:CS /n:”Microsoft.SqlServer.ReportingServices2010″ /U:”<User name>” /p:”<PassWord>” http://<Server Name>/ReportServer/reportservice2010.asmx?wsdl
After performing this command ReportingService2010.cs file is developed on the root folder
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 4.0.30319.17929]
Copyright (C) Microsoft Corporation. All rights reserved.
Writing file ‘ D MySSRSWebPortalMySSRSWebPortalReportingService2010.cs‘.
Add this document to the application. You will allow noticing all the properties and methods for reporting service 2010 in this created file. For more information about the reporting service 2010 methods and properties, visit following link:
Now get list all the reports on the server. Create one aspx page, for an instance Index.aspx
Now to obtain the list of reports from the server the ReportingService2010 have “ListChildren” technique, they give all the reports from the folder defined in the parameter. Now on page load create the reporting service object, set the network identities, and call the method, it will give the collection of catalog items. Create one repeater ID and bind with the collection.
Now if reporting server needed the validation then you have some change in code.
Create one class for an instance ReportServerCredentials that inherit IReportServerCredentials interface (add Microsoft.Reporting.WebForms reference).
Interface has two properties:
1) ImpersonationUser : We don’t need this property so Set Return NULL
2) NetworkCredentials : Set network credential for reporting service.
Interface has one method also:
GetFormsCredentials: we didn’t use this method.
In Fig 4.0.1 replace service.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; To ReportServerCredentials reportServerCredentials = new ReportServerCredentials ();service.Credentials = reportServerCredentials.NetworkCredentials;
Run the index.aspx page. You can see the list of reports name. Done!
Microsoft empowers its social database engine, SQL Server, with a couple of additional organizations that supervise various parts of enormous business learning and information taking care of, for instance, correlative data, reporting and analysis. SQL Server can work freely of these administrations; they incorporate regard by enhancing SQL Server’s capacity as a healthy information stage for making broad business insight arrangements.
Implementing SSRS Integration with your ASP.Net application empowers you to do more with less i.e. leverage the power of technology to empower your business needs. In today’s technology ecosystem it’s all about how much you can leverage on what is already there and empower your business to have backbone based on latest technology.