ReportSearch in Office Sample Application

New: 5 December 2005

This sample demonstrates how to integrate SQL Server 2005 Reporting Services into Microsoft Office 2003 using the Research Task pane. You can search and browse report server database items without leaving Office 2003.

The Research Task pane in Office 2003 allows developers to create their own research services. For example, if you have Reporting Services reports stored on a report server and you want to provide those reports to your internal users, you can develop a service using the Research Task pane that functions within Office applications, allowing your Office users to easily access reports while working on Office documents.

The ReportSearch sample shows how a Reporting Services report server database items can be exposed directly within an Office 2003 Research Task pane. The user can browse folders and reports and search for reports while using most Office 2003 applications. For instance, while writing an e-mail, a user can browse to a relevant Reporting Services report in Report Manager. The application is based on a real-world scenario and it demonstrates how to extend the reach of your reports.

Important

These samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples.

Requirements

You should be familiar with Visual Studio and either C# or Visual Basic, and your system must have installed the following applications to use the ReportSearch sample:

  • Visual Studio 2005 or compatible development environment (for viewing the project files).
  • SQL Server 2005, including Reporting Services.
  • Microsoft Office 2003.
  • Microsoft .NET Framework version 2.0. You can obtain the .NET Framework SDK free of charge. See Installing the .NET Framework SDK
  • Reporting Services samples. You can choose to install the samples during SQL Server 2005 setup. For this release, when you choose to install samples, a separate installer is installed on your computer that you can launch to extract and install samples. You can run this installer from the Start menu in the Microsoft SQL Server 2005 program group. For more information, see Installing Samples.
  • A report server that you have permission to access on your network, if you plan to use the sample client application to view the contents of a report server.
  • Two sample databases: AdventureWorksDW (data warehouse) and AdventureWorksAS (OLAP).

Location

This sample is located by default at:

C:\Program Files\Microsoft SQL Server\90\Samples\ Reporting Services\Application Samples\ReportSearch Sample

The C# solution for the code sample is located in the CS directory, and the Visual Basic solution is located in the VB directory.

Setting Up the Sample

If you have not already created a strong name key file, generate the key file using the following instructions.

To generate a strong name key file

  1. Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click SDK Command Prompt.

    -- or --

    Open a Microsoft .NET Framework command prompt. Click Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click SDK Command Prompt.

  2. Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed.

    Note

    To determine the folder where samples are located, click the Start button, point to All Programs, point to Microsoft SQL Server, point to Documentation and Tutorials, and then click Samples Directory. If the default installation location was used, the samples are located in <system_drive>:\Program Files\Microsoft SQL Server\100\Samples.

  3. At the command prompt, run the following command to generate the key file:

    sn -k SampleKey.snk

    Important

    For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.

In order to build and run this sample, the following steps need to be performed. The sample is designed and tested to run on a single machine.

Authentication and Identity Impersonation is set in web.config. The sample uses Windows Authentication. When possible, use Windows Authentication.

.

To set up the Office research service

  1. Create an Internet Information Services (IIS) vroot folder from the default sample language folder and name it “ReportSearch”. The language folder is \cs for the C# version or \vb for the Visual Basic version.

  2. Enable Integrated Windows Authentication and disable Anonymous access on the ReportSearch vroot folder.

  3. Open one of the Office 2003 applications, such as Microsoft Word 2003.

  4. Click the View menu, and click Task Pane. In the Task pane, click the drop-down arrow and select Research.

  5. Click Research options at the bottom of the Task pane. The Research Options dialog box appears.

  6. Select Add Services.

  7. In the Address box, type https://localhost/ReportSearch/reg.asmx.

  8. Click Add.

  9. Click Continue.

  10. Click Install.

Running the Sample

To view a report in Word 2003

  1. Open Word if it is not open already and open the Research task pane.

  2. In the Search for drop-down list, select Microsoft Reporting Services Sample and press Enter or click the Go button.

  3. Type a folder path or a report name to view catalog items within the task pane.

    Examples:

    • Type a forward slash (/) to render all folders and reports within the root folder.
    • Type any search term to return all folders and reports in any folder with the search term. For example, type “sales” to return all reports and folders containing the word “sales”.
  4. Once folders and/or reports are rendered in the task pane, click a folder to browse to a report summary or a report link to browse to a report within Report Manager.

    Note

    Typing a question mark (?) in the Search for text box will display the Advanced Search Page to search within a specific folder, name, or description field.

Viewing the Sample

To view the sample code

  1. Navigate to the ReportSearch Sample language folder. The language folder is \cs for the C# version or \vb for the Visual Basic version.

  2. Click Open.

See Also

Tasks

SQL Server Reporting Services Samples

Other Resources

Research Services on MSDN

Help and Information

Getting SQL Server 2005 Assistance