To load and display a report using the Viewer control in a WPF application,
Note: If Page/RDLX report is selected from dropdown of Source property (containing relative path), 'Copy to Output Directory' for selected report should be set as 'Copy always/Copy if newer' otherwise error "Could not find file ... " appears on loading WPF Viewer.
Caution: In WPF Viewer control, previewing code-based Section reports using Source and SourceFormat properties is not supported.
Visual Basic.NET code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.vb. |
Copy Code
|
---|---|
Viewer1.LoadDocument("rptSingleLayout.rdlx") |
C# code. Paste INSIDE the viewer1_Loaded event in MainWindow.xaml.cs. |
Copy Code
|
---|---|
viewer1.LoadDocument("rptSingleLayout.rdlx"); |
Note: