-
Notifications
You must be signed in to change notification settings - Fork 204
WPF Viewer
Peter Gill edited this page Jun 7, 2026
·
1 revision
dotnet add package Majorsilence.Reporting.LibRdlWpfViewerMajorsilence Reporting includes a WPF report viewer. Call RdlEngineConfig.RdlEngineConfigInit() once at application startup, then use SetSourceFile and Rebuild (both async) to load the report.
using Majorsilence.Reporting.Rdl;
class ReportWindow : System.Windows.Window
{
public ReportWindow()
{
Height = 600;
Width = 800;
Loaded += async (s, e) => await LoadReportAsync();
}
private async Task LoadReportAsync()
{
var rdlView = new Majorsilence.Reporting.LibRdlWpfViewer.RdlWpfViewer();
await rdlView.SetSourceFile(new Uri(@"Path\to\your\report.rdl"));
await rdlView.Rebuild();
Content = rdlView;
}
}
class Program
{
[STAThread]
static void Main()
{
// One time per app instance
RdlEngineConfig.RdlEngineConfigInit();
var app = new System.Windows.Application();
app.Run(new ReportWindow());
}
}class Program
{
[STAThread]
static void Main()
{
System.Windows.Window frm = new System.Windows.Window();
frm.Height = 600;
frm.Width = 800;
LibRdlWpfViewer.RdlWpfViewer rdlView = new LibRdlWpfViewer.RdlWpfViewer();
rdlView.SourceFile = new Uri(@"Path\to\your\report.rdl");
rdlView.Rebuild();
frm.Content = rdlView;
System.Windows.Application app = new System.Windows.Application();
app.Run(frm);
}
}