Elixir Report

Integration of Elixir Client .Net 2003 with VB
Elixir Report Server comes with a .Net ERS Client  for invoking generation from Report Server.  This documentation illustrate how this .Net ERS Client can be integration with different programming language as VB in a window platform

Requirement
1) Elixir Report Server version 5.1 or greater
2) Elixir Report Server .Net Client  ( ERSNetClient)
3) Windows OS
4) Microsoft Visual Studio .NET 2003
5) .Net Frame worked install (optional as it is part of Visual VB installation)

Here are the steps needed to create .Netframe  VB project

1) Create a new Console Application (.NET)

Create CLR Project

2) Enter the values as Project and Solution Name

 Enter values

3) Once the Project is created, next step is to add the .Net library of ERSClient to be reference in the project.
 go the the left hand panel under Solution Explorer View property table select the References Node.
Right click on the right mouse button to launch a popup menu and click on 'Add Reference'

 Add Reference

4)  At the Reference Property Page

Property Page

5) Add new Reference by click a Add New Reference button and choose the browse tab.

Browse for dll

6) Select the Dlls  by adding the dll ERSClient.dll and Log4j.dll

Locate

7) Select one of the reference and add to the reference.

If the dlls are added then the reference name will appear in ERSClient and log4net.

add

8) You can  return to the main view, at the class view.  You should be able to view the function available in ERSClient.

ERSClient

9)  Code the different reporting functions


a)   Include the namespace of report and log4j

Imports com.elixirtech.net
Imports com.elixirtech.ers2.client


b) Create a new ERSClient

Dim ersClient As New ERSClient("localhost", 7001, "Anonymous", "anonymous")

c) Examples source : links for full source code

Example 1:  List filesystem in the Server repository

Dim filesystems() As String = ersClient.GetFileSystems()
Dim i As Integer
For i = 0 To filesystems.Length - 1
   Console.WriteLine(filesystems(i))
Next i

Example 2:  List available reports in file system in Report Server

Dim reports() As String = New String() {}
If filesystems.Length > 1 Then
   reports = ersClient.GetReports(filesystems(1))
End If

Dim myreport As String
If reports.Length > 0 Then
   Dim j As Integer
   For j = 0 To reports.Length - 1
      Console.WriteLine(reports(j))
   Next j
   myreport = reports(j - 1)
End If


Example 3: Generate a Report from FileSystem "ReportSamples"

Dim mimeType As String = "application/pdf"
Dim filename As String = "Report.pdf"

Dim file As New FileInfo(filename)

If file.Exists Then
   file.Delete()
End If

Dim fs As New FileStream(filename, FileMode.CreateNew)
Dim properties As New System.Collections.Hashtable
Dim jobInfo As JobInfo = ersClient.RenderReport(myreport, mimeType, fs, properties, "me")

'print report information
Console.WriteLine("*** Start Report Generated information ***")
Console.WriteLine(String.Concat("Report: ", jobInfo.name))
Console.WriteLine(String.Concat("Owner: ", jobInfo.jobowner))
Console.WriteLine(String.Concat("Page Count: ", jobInfo.pageCount.ToString()))
Console.WriteLine(String.Concat("Byte Count: ", jobInfo.byteCount.ToString()))
Console.WriteLine()
Console.WriteLine("*** End Report Generated information ***")

'close connection
ersClient.Close()
fs.Close()
Console.WriteLine("Test Complete")


Build :

Build

Execute
Execute

Output to command console
result

Preview

preview


View report in PDF viewer

Viewer

Generated report.  (actual pdf doc)

If you have any enquire, please send a mail to :

Copyright © since 2005 Elixir Technology Pte Ltd. All rights reserved.