WPF Viewer for Reporting Services 2008/2012 Getting Started

Download Getting Started for WPF Viewer for Reporting Services as PDF...

Introduction

The target of the following guide is to demonstrate the basic moments of the use of WPF Viewer for Reporting Services 2008/2012. It gives minimum necessary knowledge in order to start working with the component. We will examine the process of generation of application with the use of WPF Viewer for Reporting Services 2008 step by step. We will consider creation and configuration of the service and at last integration of the report viewer component in the application. Your application can be configured to use the processing capability of Microsoft SQL Server 2008/2008 R2/2012 Reporting Services report server.

Prerequisites

  • .NET Framework 4.0
  • Visual Studio 2008/2012
  • Microsoft SQL Server 2008/2012 Reporting Services (Enterprise or Standard editions)
  • Microsoft SQL Server 2008 Sample Reports


Creating application using Microsoft SQL 2008/2008 R2 /2012 Reporting Services report server

Step 1

Create a new WPF Application project.





Step 2

Change the project properties. Select the Project\WpfApplication Properties… item in the main menu.



Select the Target framework\.NET Framework4 item in the Application tab.



Press the “Yes” button in the opened window.

Step 3

Note: We suppose you have Microsoft SQL Reporting Services installed and configured.


It’s necessary to add the report viewer component to the WPF application for displaying reports. Therefore you should add a reference to the PerpetuumSoft.ReportingServices.Viewer. This assembly, containing ReportViewer (right-click “Sample Application” in "Solution Explorer" and choose item “Add Reference” in context menu). Add references to the following assemblies to the project:

  • PerpetuumSoft.Framework
  • PerpetuumSoft.ReportingServices.Viewer.Core
  • PerpetuumSoft.ReportingServices.Viewer.ExtentionLink
  • PerpetuumSoft.ReportingServices.Viewer.WPF

Step 4

To create a WPF report viewer from your application.

Open MainWindow.xaml in the markup designer and add xml namespace for the PerpetuumSoft.ReportingServices.Viewer.WPF

<Window x:Class="WpfApplication5.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:perpetuum="clr-namespace:PerpetuumSoft.ReportingServices.Viewer.WPF;assembly=PerpetuumSoft.ReportingServices.Viewer.WPF"

        Title="MainWindow" Height="350" Width="525">

    <Grid>

        <perpetuum:ReportViewer x:Name="reportViewer"/>

    </Grid>

</Window>

Open the MainPage.xaml.cs source code and add the following code.

public MainWindow()

{

    InitializeComponent();

    reportViewer.ReportingServicesUrl = @"http://localhost/ReportServer/ReportExecution2005.asmx";

    reportViewer.ReportingServicesCredential = new System.Net.NetworkCredential()

    {

        Domain = "",

        UserName = "",

        Password = ""

    };

    reportViewer.ReportName = @"/AdventureWorks 2008 Sample Reports/Product Catalog 2008";

    reportViewer.PerformAutomaticRendering = true;

}

Pay Attention

In order to configure your WPFViewer you just need to set up ReportingServicesUrl property of the ReportViewer object. Also you should provide your Credentials for accessing Reporting Services including Domain, UserName and Password. If you will not set ReportingServicesCredential property windows authentication will be used to access reporting services.

Step 5

Install PerpetuumSoft Xaml Rendering extension.

Note: The extension must be installed ONLY to Microsoft SQL Server Reporting Services 2008/2008 R2/2012 Developer, Enterprise or Standard editions. Make sure that your SQL Server edition supports custom rendering extensions.

Run PerpetuumSoft.XamlExtension.msi on the machine where Microsoft SQL Server Reporting Services is installed.



Follow the installer instructions on the screen.

The installer determines your SQL configurations and offers the list of the available Reporting Services instances.

Check/uncheck the instances to install/uninstall Rendering Extension to selected Reporting Services instances and click Apply Changes button.

Restart the affected instances of Reporting Services.

Step 6

Run Sample Application.

Press Ctrl-F5 in Visual Studio environment to run the application.


If you cannot run application or any errors occurred during execution please contact Perpetuum Software support team by submitting a ticket or by e-mail support@perpetuumsoft.com.

Please provide as much information as possible in the support request:

  • You can select the error message, copy it to clipboard and attach to your email.
  • You may also attach log.txt file (if it exists).

Conclusion

We have examined basic steps and got a simple and quite operable application. We didn’t have to write thousand lines of code – we only used ready-made implementation. It will be enough in most cases. If required behavior differs greatly from the one provided by default, you can change not only many aspects of the WPF Viewer for Reporting Services 2008/2008R2 /2012 work but also the appearance of the report viewer.


Add Feedback