Designer Control - majorsilence/Reporting GitHub Wiki
The Majorsilence Reporting designer control can be used from a windows forms or wpf application.
Make sure to add references to
- Majorsilence.Reporting.ReportDesigner
dotnet add package Majorsilence.Reporting.ReportDesignerIf you are adding to a WPF application also make sure you add references to
- System.Windows.Forms
- WindowsFormsIntegration
One last note, as with any project make sure RdlEngineConfig.xml is copied to your bin directory and the correct path to the data providers dll is set. See Database Providers Howto.
See https://github.com/majorsilence/My-FyiReporting/tree/master/Examples/SampleDesignerControl for a fully working winform and WPF example.
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form frm = new Form();
var ctl = new Majorsilence.Reporting.RdlDesign.RdlUserControl();
ctl.OpenFile(@"The path to the rdl file.rdl");
ctl.Dock = DockStyle.Fill;
frm.Controls.Add(ctl);
Application.Run(frm);
}<Window x:Class="SampleDesignerControlWPF.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:myctrl="clr-namespace:Majorsilence.Reporting;assembly=RdlDesigner"
Title="MainWindow" Loaded="Window_Loaded_1" Height="auto" Width="auto">
<DockPanel >
<WindowsFormsHost Margin="0" Name="windowsFormsHost1" DockPanel.Dock="Top">
<myctrl:RdlUserControl x:Name="reportDesigner" />
</WindowsFormsHost>
</DockPanel>
</Window>private void Window_Loaded_1(object sender, RoutedEventArgs e)
{
System.Windows.Forms.Application.EnableVisualStyles();
reportDesigner.OpenFile(@"The path to the rdl file.rdl");
}