Databases Reference
In-Depth Information
After updating the IIS settings to use Integrated Authentication, you will have to make some modifica-
tions to your ASP.NET web application.
Modifying the web.config File
In the web application created for this demonstration, you want to pass the user's security credentials to
the Reporting Services Web service. To accomplish this, you have to allow your ASP.NET application to
impersonate the currently logged-on user. Setting up impersonation requires adding the following line of
code to the web.config file; place this line after the authorization tag in the file:
<identity impersonate=”true” />
Setting Up the Reporting Service Web Service
Just as in any Windows application, you need to set a reference to the Reporting Services Web service.
The details for creating the reference are identical to those found in the “Rendering through Windows”
section, so we will not go into the details here.
For this example, I've added a web reference to http://localhost/reportserver/
reportservice.asmx?wsdl and named it RSService.
Rendering to the Response Object
Now that you have set up Integrated Authentication and modified the web.config file, you're ready to
write some code. In this application, you will have one page that takes in a report path and format from
the URL. You'll use this information to call the Render method of the Reporting Services object and
write that information back to the response stream.
This sample will use one ASP.NET page called Render.aspx . Place your code sample in the Page_Load
event of the page. This would be a logical approach when developing an application around Reporting
Services. It allows you to have one point of entry to the Report Server. The page could then be referenced
from other areas of an application.
Let's add some code to the page's Page_Load event to retrieve the report path and format from the
HTTP Request:
C#
string path = Request.Params[“Path”];
string format = Request.Params[“Format”];
VB
Dim path As String = Request.Params(“Path”)
Dim format As String = Request.Params(“Format”)
Now that you have the report path and format, you can start setting up the ReportingService object.
This is an instance of the Web service reference, similar to what you did in the Windows application.
Like you did with the Windows application, you will create an instance of the ReportingService
object and then set the credentials to the credentials of the currently logged-on user.
Search WWH ::




Custom Search