Skip to content
Peter Gill edited this page May 3, 2024 · 6 revisions
dotnet add package Majorsilence.Reporting.LibRdlWpfViewer

My-FyiReporting includes a WPF report viewer. To use follow the instructions below.

First add DataProviders.dll, RdlCri.dll, RdlEngine.dll, RdlViewer.dll, and LibRdlWpfViewer.dll as references to your project. Next make sure RdlEngineConfig.xml is part of your project. Set build action to "None" and Copy to output directory to "Copy if newer". Make sure that in RdlEngineConfig.xml that the data provider you are using has the correct CodeModule path.

If you are using something other then Microsoft sql as a database you may need to enter a path to the assemblies. For example if you are using SQLite make sure that the path to the System.Data.Sqlite.dll is set. If System.Data.Sqlite.dll is going to be in the same directory as your application you are fine.

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);
	}
}