-
Notifications
You must be signed in to change notification settings - Fork 201
Embed the Designer
Peter Gill edited this page May 3, 2024
·
21 revisions
dotnet add package Majorsilence.Reporting.ReportDesigner
In your project add a new reference to RdlDesigner.exe. Once that is done you can use the designer in your program.
var designer = new fyiReporting.RdlDesign.RdlDesigner("myFyiChannel", false);
designer.Show();
designer.OpenFile(@"Path\to\a\report.rdl");
designer.Text = "Test Window";
System.Drawing.Icon a = new Icon(@"Path\to\yourIcon.ico");
designer.Icon = a;
You can open multiple reports with one designer by calling the OpenFile function on multiple reports.
fyiReporting.RdlDesign.RdlDesigner designer = new fyiReporting.RdlDesign.RdlDesigner("myFyiChannel", false);
designer.Show();
designer.OpenFile(@"SimpleTest1.rdl");
designer.OpenFile(@"SimpleTest2.rdl");
designer.OpenFile(@"SimpleTest3.rdl");
var designer = new fyiReporting.RdlDesign.RdlDesigner("myFyiChannel", false);
designer.Show();
designer.OpenFile(@"Path\to\a\report.rdl");
designer.SavedFileEvent += new fyiReporting.RdlDesign.RdlDesignerSavedFileEventHandler(designer_SavedFileEvent);
void designer_SavedFileEvent(object sender, fyiReporting.RdlDesign.RdlDesignerSavedFileEvent e)
{
System.Console.WriteLine(e.FilePath.AbsolutePath);
}
var dlgDB = new fyiReporting.RdlDesign.DialogDatabase(this)
dlgDB.SetConnection("The Connection String", false, DialogDatabase.ConnectionType.SQLITE);
dlgDB.ShowDialog();
if (dlgDB.DialogResult == DialogResult.OK)
{
string rdl = dlgDB.ResultReport;
System.IO.File.WriteAllText("Path\to\new\report.rdl", dlgDB.ResultReport);
}
Dim designer As New fyiReporting.RdlDesign.RdlDesigner("myFyiChannel", false)
designer.Show()
designer.OpenFile("Path\to\a\report.rdl")
designer.Text = "Test Window"
Dim a As New System.Drawing.Icon(@"Path\to\yourIcon.ico")
designer.Icon = a
At the time of this writing that is all that is supported when using the designer. More methods, properties, and events will be added to make it easier to work with in the future.