This step-by-step article describes how to create a sample
Microsoft ASP.NET Web application that uses the Microsoft SQL Server 2000
Reporting Services SOAP APIs and the Microsoft SQL Server 2005 Reporting
Services SOAP APIs to perform the following:
Render a report that is deployed on a report server to a
supported file format, such as the .pdf file format.
Open the rendered report on a Web page without saving the
file that corresponds to the rendered report on your computer.
Note To render the report to the requested file format by using the
ASP.NET Web application, the program that supports the file format must be
installed on your computer. For example, to view a report that is rendered to
the .pdf file format, Adobe Acrobat Reader must be installed on your
computer.
You can generate a report by using Reporting Services, and
you can view the report by using Report Manager. Report Manager is included
with Reporting Services. By using Report Manager, you can render your report to
different file formats that are supported by Reporting Services. To render a
report to a specific file format, follow these steps:
Start Report Manager.
Locate your report in Report Manager, and then click the
report to preview your report.
In the Select a format list, click the
file format that you want to use to render your report, and then click
Export.
After you click Export in Report Manager, the
File Download dialog box opens. The File
Download dialog box provides an option to save the rendered report on
your computer. Even if you open the report without saving the report, a file
that corresponds to the rendered report is created on your computer.
If you want to render a report to the requested file format without
creating the file that corresponds to the rendered report on your computer, you
can use the Render method in the Reporting Services SOAP APIs. For more information
about the Render method for SQL Server 2000 Reporting Services, visit the
following Microsoft Web site:
To create a sample ASP.NET Web application to render a report that
is deployed on a report server to the requested file format and to open the
rendered report on a Web page by using the Reporting Services SOAP APIs, follow
these steps.
Note This sample application renders the Company Sales sample report
to the .pdf file format. Therefore, you must make sure that the Company Sales
sample report is deployed on your report server in the SampleReports folder.
You must also make sure that a program such as Adobe Acrobat Reader is
installed on your computer before you run this application.
Use Microsoft Visual Studio .NET 2003 to render the Company Sales sample report that is included in SQL Server 2000 Reporting Services or SQL Server 2005 Reporting Services
Start Microsoft Visual Studio .NET 2003.
On the File menu, click
New, and then click Project.
In the New Project dialog box, under
Project Types, click Visual C#
Projects.
In the New Project dialog box, under
Templates, click ASP.NET Web
Application.
In the Location box, type
http://ReportServerName/RenderCompanySales,
and then click OK to create the project.
Add a Web reference to the ReportService Web service. To
do this, follow these steps:
On the Project menu, click Add
Web Reference.
In the Add Web Reference dialog box,
type
http://ReportServerName/ReportServer/ReportService.asmx
in the URL box, and then click Go.
In the Web reference name box, type
RSWebReference, and then click Add
Reference.
In the left pane, under Toolbox, click
Web Forms, and then double-click Button to
add a button control to the Web form.
Set the properties of the button control by using the
following information:
(ID):
RenderTest
Text: Render Report in PDF
Format
On the View menu, click
Code.
Add the following code at the top of the code window:
using RenderCompanySales.RSWebReference;
Add the following method as the event handler of the click
event for the RenderTest button in your code:
For more information, click the following article
number to view the article in the Microsoft Knowledge Base:
842854
(http://support.microsoft.com/kb/842854/
)
Documentation errors in the ReportingService.Render Method topic, the ReportingService.CreateDataDrivenSubscription Method topic, and the ReportingService.CreateReportHistorySnapshot Method topic in Reporting Services Books Online