2001 Gtk Viewer Linux - majorsilence/Reporting GitHub Wiki

The Majorsilence.Reporting.RdlGtk3 is a gtk-sharp-3 widget and there is also a gtk 3 viewer.

Gtk Rdl Viewer in Action

Lets say I added a new instance of the RdlGtkViewer class called viewer to my project. I can load a report with parameters with the following line of code.

var viewer = new Majorsilence.Reporting.RdlGtk3.RdlGtkViewer();
viewer.LoadReport(new Uri(@"/home/peter/Projects/My-FyiReporting/Examples/SqliteExamples/SimpleTest3WithParameters.rdl"), 
    "TestParam1=Hello and Goodbye&TestParam2=Testing parameter 2"); 

The code above is passing in the filepath to the report and the parameters that the reports takes.

The example below is a full working example.

 using System;
 using Gtk;
 
 public class GtkRdlViewerExample {
 
   public static void Main() {
     Application.Init();
 
     Window myWin = new Window("Gtk Sharp RDL Viewer Example ");
     myWin.Resize(800,800);
 
     var viewer = new Majorsilence.Reporting.RdlGtk3.RdlGtkViewer();
     viewer.LoadReport(new Uri(@"/home/peter/Projects/My-FyiReporting/Examples/SqliteExamples/SimpleTest3WithParameters.rdl"), 
         "TestParam1=Hello and Goodbye&TestParam2=Testing parameter 2"); 
 
     // Add the gtk sharp viewer to the form  
     myWin.Add(viewer);
    
     myWin.ShowAll();
 
     Application.Run();   
   }
 }