Progress® Telerik® Reporting R2 2019

How to: Add report viewer to a WPF .NET Core project

This article explains the steps needed to integrate the WPF report viewer to a .NET Core project.

Prerequisites:

  • Visual Studio 2019 or newer

  • .NET Core SDK 3 Preview 4 or newer

  • WPF App (.NET Core) project

  1. Add the following assembly references (available in Telerik Reporting installation Bin directory) or NuGet package references (available in Telerik private NuGet repository):

    • Telerik.Reporting (located in Bin\netstandard2.0)

    • Telerik.ReportViewer.Wpf (located in Bin\netcoreapp3.0)

    • Telerik.ReportViewer.Wpf.Themes (located in Bin\netcoreapp3.0)

    • Telerik.Windows.Controls (located in Bin\WpfViewerDependencies)

    • Telerik.Windows.Controls.Input (located in Bin\WpfViewerDependencies)

    • Telerik.Windows.Controls.Navigation (located in Bin\WpfViewerDependencies)

    • Telerik.Windows.Data (located in Bin\WpfViewerDependencies)

  2. Merge the required theme resources to the application in the App.xaml:

    <Application x:Class="WpfApplication1.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/System.Windows.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Input.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Navigation.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.ReportViewer.Wpf.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
    </Application>
  3. Add the following namespaces to the target Window declaration:

    xmlns:tr="http://schemas.telerik.com/wpf"
    xmlns:telerikControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:telerikReporting="clr-namespace:Telerik.Reporting;assembly=Telerik.Reporting"
  4. Add the WPF Report Viewer declaration to the target Window and set the proper UriReportSource.Uri relative path:

    <tr:ReportViewer Grid.Row="1" x:Name="ReportViewer1" HorizontalAlignment="Stretch"> 
        <tr:ReportViewer.ReportSource> 
            <telerikReporting:UriReportSource Uri="..\..\..\..\..\..\Report Designer\Examples\Report Catalog.trdp" /> 
        </tr:ReportViewer.ReportSource> 
    </tr:ReportViewer>

See Also

In this article
Not finding the help you need?