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:
Use breadcrumbs to navigate back to the original report. The breadcrumb control automatically appear below the Document Viewer toolbar:
Files to Review
Documentation
More Examples
- Reporting for WPF - Create a Drill-through Report in Code
- Reporting for WinForms - Create a Drill-through Report
Does this example address your development requirements/objectives?
(you will be redirected to DevExpress.com to submit your response)
Example Code
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;
}
}
}
Visual BasicImports 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
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>
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>