AspAlliance.com LogoASPAlliance: Articles, reviews, and samples for .NET Developers
URL:
http://aspalliance.com/articleViewer.aspx?aId=692&pId=-1
Visual Studio 2005 Beta 2 and Reporting Services
page
by Terry Voss
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 14097/ 14

The Most Interesting New Feature for Me

A client recently asked me to prepare to train someone on SQL Server Reporting Services for their latest project. The project was a Visual Studio 2005 Beta 2 Windows Forms project, with an ASP.NET project also involved. Knowing that Reporting Services in Visual Studio 2003 is a Business Intelligence project that is added as another project in a solution consisting of many projects, I wondered how Reporting Services would be handled in Visual Studio 2005 since a solution in the new IDE is always one project, not multiple projects.

Also, SQL Server Reporting Services for Visual Studio 2003 has a complex architecture that relies heavily on SQL Server 2000, so I was worried that my client had decided to use SQL Server 2000 for their project’s data. I was concerned that the support for Visual Studio 2005 Reporting Services would rely on SQL Server 2005, which would mean that we could not take advantage of this reporting capability.

What I have learned is that Reporting Services now works in two processing modes: Remote and Local. Remote mode uses a five-part architecture: a Windows Forms application for designing reports inside of Visual Studio; a Web Forms application for managing reports, folders, security, caching, and data; a Windows service for running reports; two SQL Server databases to hold the compiled version of deployed reports; and finally a web service to allow code manipulation of the reports. Local mode uses only those elements available inside a Visual Studio 2005 application, whether it be a Web Forms or a Windows Forms application.

I’ve liked many aspects of Reporting Services since its inception, but for some applications I didn’t want to rely on the existence of a remote server on my target client. This problem is now solved, as I can use Reporting Services either remotely or locally.

Remote processing mode still provides many services unique to its architecture, such as SQL Server type security, scheduled email reporting, and secure reporting via public HTTP URLs.

All of these features work very similarly for Web Forms and Windows Forms applications, which is a major positive. In the Visual Studio Toolbox, within the Data group of controls, there is a ReportViewer control that may be dragged to a form. In Windows Forms, you can Dock it to All so that it takes over the form entirely with a nice tool band at the top for Paging, Zooming, Output formats, etc. In Web Forms, you can set the width to 100% and the height to 100% to get the similar effect.

Creating a Local Report

Below is what the ReportViewer looks like in the ASP.NET designer when the control is not fully expanded.

Figure 1 – The ASP.NET version of the ReportViewer control, in context.

 

On the upper right-hand side of the control, notice the small smart tag arrowhead pointing to the right. Clicking on this tag is a fast way to access the settings of the crucial properties needed to get the report running. Also note the Data Sources tab under the Toolbox tab on the left edge of the image.

The steps for creating and running a report in Local mode are as follows.

  1. Create a new form and drag a ReportViewer control onto it.
  2. Create a new Report (via the smart tag or by pressing Ctrl-Shift-A and selecting Report as the type of item to add).
  3. Create a DataSource via the Data Sources tab's visual designer. This DataSource will be used by the report created in step 2.
  4. Drag fields from the DataSource into the Header and Table cells of the new report.
  5. Open the form created in step 1, and use the smart tag of the ReportViewer control to select the report which was created in step 2.
  6. Now, since the default is Local versus Remote mode, we simply need to set our form as the startup form and run it.

If you want to run in Remote mode using reports published to SQL Server, set ProcessingMode to Remote via the dropdown list, and set the location of the report with a URL. See the pertinent properties in Figure 2 below.

Figure 2 – Properties Relating to Local versus Remote Reporting

 

These reports have many advantages as discussed in an earlier article, Comparing HTML Reporting and MS SQL Server Reporting Services.

The six steps above can be completed in 60 seconds for a simple one-to-many table-based report that requires no code to be supplied by the developer. The new Reporting Services has become even more valuable to me as a reporting option.

 



©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-17 10:25:49 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search