Example E3357
Visible to All Users

Reporting for WPF - Create a Drill-through Report

This example shows a drill-through report in a WPF application. This report type keeps the original report compact while still allowing access to more detailed information.

The drill-trough report type requires a parameter binding to display connected data. You also need to set a filter string in the detail report to display product records for the selected category. See the guide for more detailed steps: Create Drill-Through Reports.

In the app, you can click a Category entry to invoke a detail report with products:

Reporting for WPF - Click on a Drill-through Report

Use breadcrumbs to navigate back to the original report. The breadcrumb control automatically appear below the Document Viewer toolbar:

Reporting for WPF - Go back in a Drill-through Report

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

Example Code

WpfApp1/MainWindow.xaml.cs
C#
using DevExpress.Mvvm; using DevExpress.Xpf.Core; using DevExpress.XtraReports.UI; namespace WpfApp1 { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : ThemedWindow { public MainWindow() { InitializeComponent(); DataContext = new ViewModel(new XtraReportCategories()); XtraReportCategories report = new XtraReportCategories(); window.DocumentSource = report; } public class ViewModel : BindableBase { public XtraReport Report { get; } = new XtraReport(); public ViewModel() { } public ViewModel(XtraReport report) => Report = report; } } }
WpfAppVb/MainWindow.xaml.vb
Visual Basic
Imports DevExpress.Mvvm Imports DevExpress.Xpf.Core Imports DevExpress.XtraReports.UI Imports WpfAppVb.Drill_through_example Public Class MainWindow Inherits ThemedWindow Public Sub New() InitializeComponent() DataContext = New ViewModel(New XtraReportCategories()) End Sub End Class Public Class ViewModel Inherits BindableBase Public ReadOnly Property Report() As XtraReport Public Sub New() End Sub Public Sub New(ByVal report As XtraReport) Me.Report = report End Sub End Class
WpfApp1/MainWindow.xaml
XAML
<dx:ThemedWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApp1" xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" x:Class="WpfApp1.MainWindow" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <dxp:DocumentPreviewControl x:Name="window" RequestDocumentCreation="True" DocumentSource="{Binding Report}"/> </Grid> </dx:ThemedWindow>
WpfAppVb/MainWindow.xaml
XAML
<dx:ThemedWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfAppVb" xmlns:dxp="http://schemas.devexpress.com/winfx/2008/xaml/printing" x:Class="MainWindow" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <dxp:DocumentPreviewControl x:Name="window" RequestDocumentCreation="True" DocumentSource="{Binding Report}"/> </Grid> </dx:ThemedWindow>

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.