Skip to content
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.

Simple Usage C#

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;

NOTE 1

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

Track file saves - C#

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

Create a new report - C#

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

Simple Usage VB.NET

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.