Showing a Report in the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.This example shows the two basic ways to display a report in a WPF application: in an embedded WPF viewer control, or in a separate viewer window.
Embedding the viewer control. Place a
Opening the report in a window. If you do not need an embedded control, call
The
Embedding the viewer control. Place a
StiWpfViewerControl in your XAML, then load and render a report and assign it:var report = new StiReport();
report.Load(@"Reports\SimpleList.mrt");
report.Render();
StiWpfViewerControl1.Report = report;Opening the report in a window. If you do not need an embedded control, call
ShowWithWpf() and the report opens in a ready-made WPF preview window:var report = new StiReport();
report.Load(@"Reports\SimpleList.mrt");
report.ShowWithWpf();The
StiWpfViewerControl lets you position the preview anywhere in your own WPF interface, while ShowWithWpf() is the quickest way to display a report without designing a window.