Hands On Lab: Building Your First Reporting Application with the Visual Studio 2010 ReportViewer Control

Version: 1.0

Description

This Hands On Lab will show you how to develop a custom application that displays interactive SQL Server 2008 R2 Reporting Services Reports from a custom application using the Visual Studio 2010 ReportViewer control.

Overview

This lab will introduce two important Reporting Services programming capabilities that enable developers to embed reports and reporting functionality into their applications. The first capability is delivered through Web services. The second capabilty is delivered with the ReportViewer control.

Objectives

The objectives of this exercise are to:

  • Connect to the ReportService2010 Web service
  • Invoke the ReportService2010 Web service’s ListChildren method
  • Configure the ReportViewer control in remote processing mode

System Requirements

You must have installed the following items to complete this lab:

Setup

All the requisites for this lab are verified using the Configuration Wizard. To make sure that everything is correctly configured, follow these steps.

Note:
To perform the setup steps you need to run the scripts in a command window with administrator privileges.

  1. Launch the Configuration Wizard for this lab by double-clicking the Dependencies.dep file located under the Source\Setup folder of this lab. Install any pre-requisites that are missing (rescanning if necessary) and complete the wizard.

Cleanup

  1. There is no need to cleanup if you intend to continue the sequence of labs in this training kit.
  2. To restore the original state of the AdventureWorksDW2008R2 database, execute the Cleanup.cmd script located under the Setup folder in the Source folder of this lab.

Using the Code Snippets

With code snippets, you have all the code you need at your fingertips. The lab document will tell you exactly when you can use them, as shown in the following figure.

Figure 1

Using Visual Studio code snippets to insert code into your project

To add a code snippet using the keyboard (C# only)

  1. Place the cursor where you would like to insert the code.
  2. Start typing the snippet name (without spaces or hyphens).
  3. Watch as IntelliSense displays matching snippets' names.
  4. Select the correct snippet (or keep typing until the entire snippet's name is selected).
  5. Press the Tab key twice to insert the snippet at the cursor location.

Figure 2

Start typing the snippet name

Figure 3

Press Tab to select the highlighted snippet

Figure 4

Press Tab again and the snippet will expand

To add a code snippet using the mouse (C#, Visual Basic and XML)

  1. Right-click where you want to insert the code snippet.
  2. Select Insert Snippet followed by My Code Snippets.
  3. Pick the relevant snippet from the list, by clicking on it.

Figure 5

Right-click where you want to insert the code snippet and select Insert Snippet

Figure 6

Pick the relevant snippet from the list, by clicking on it

Exercises

This Hands-On Lab comprises the following exercise:

  1. Developing a Reporting Application

Estimated time to complete this lab: 30 minutes.