C# .Net


Introduction,

The Elixr Report Server .Net Client (com.elixirtech.ers2.client.ERSClient) component provides the API to interface with the Elixir Report Server. The following  functionalities provide are


a) List the available filesystem in the Server Repository

API   public string[] GetFileSystems()
sample ERSClient ersclient = new ERSClient( .....  );
string[] values    = ersclient.GetFileSystems();
ersclient.Close();
.
b) List the available item in the filesystem as reports.

API   public string[] GetReports(string fs)
     
fs is the name of the file system you to list the report available
sample ERSClient ersclient = new ERSClient( .....  );
string[] values    = ersclient.GetFileSystems();
ersclient.Close();


c) Discover the parameters available with a report
           this allow you customize  GUI such as web forms  to submit to dynamics data to the server.

API   public Parameter[] GetParameters(String report)
     
fs is the name of the file system you to list the report available
sample ERSClient ersclient = new ERSClient( .....  );
Paramter[] values    = ersclient.GetParameters("/MyFileSystem/Myfolder/MyReport.rml" );
\
ersclient.Close();


d)  Request for generating report from report server

API   public JobInfo RenderReport(string reportName, Stream os, string mimeType, string propertylist, string target)
     
fs is the name of the file system you to list the report available
sample FileStream fs = new FileStream(cacheLocation+filename,  FileMode.CreateNew);    
...
ersclient.RenderReport(
            "/MyFileSystem/MyFolder/MyTemplate.rml",
            "application/pdf",
            fs,
            properties,
            "me"
        );  
ersclient.Close();


The full C# sample can be found in the source directory.

Programming with Visual Studio C# 2005

The following steps show how you can create a C# console application in Visual C# 2005 with  Elixr Report Server .Net Client dll.


1) Create a Console Application.

Create new project

2) Will create a main


Main

3) Go to Menu->Project->Add Reference to add the DLLs
The two dlls needed to part of the application are ERSClient.dll and log4net.dll.


Add


4) Once the DLLs are added, the class ERSClient should appear on the right panel, Solution Explorer.

DLL)

5) Insert  code set need to access the report server.

Source