Skip navigation links
Craftsman
VO Conversion
BridgeMaster
Skip navigation links
Home
Craftsman
BridgeMaster
Yarra Valley Bridge Club
Other Products
SQL Master
TrustMaster
SO ReportRuntime
Training
Microsoft Office
Services
Our Services
Free Consulting Offer
Database and Application Migration
About Us
Contact Us
Map and directions
Visual Objects
VO Conversion
Links
SOReportRuntime 
 
 

Microsoft SQL Server Reporting Services provides a way to run reports completely on the client. This requires the installation of the Reportviewer component and assumes the application will be responsible for accessing the data source and passing that into the component (there is no longer a Report Server to do any processing). This component can easily be embedded in .Net applications and typically those applications connect to the database, generate a .Net DataSet object and pass that to the preview window.

For 32bit environments such as VO it is impossible to use that in this way so you will need to wrap this functionality in a class and expose that using com-interop. Although not overly complex it is a bit of work which is why Software Objectives created the SOReportRuntime component (RDLCPrint.Exe) and a VO-interface class (iSOReportRuntime) to use that. added to that we have created a demonstration application which adds user inteface components ready to be used in your own application.

This VO Library and .Net component is available from Software Objectives and comes with free email and im-support contact us via email if you'd like to know more.

Pricing: The DLL-version with documentation is $AUD 150,- and the Pro version including im-support and full sourcecode is $AUD 999,- .

 Below is a tutorial on different ways to use Reporting Services Reports with Visual Objects. 

Implementing Reporting Services in Visual Objects

There are three ways a Visual Object application can make use of SQL Server Reporting Services reports.

This description assumes the reader is familiar with how to build reports using Visual Studio and how to deploy reports to a report-server (if not plenty of docs in Books on-line and MSDN, or try the getting started at VoConversion.com.au [1]).

1.Using Report Server

Pre requisites

A working Report Server in your LAN, for printing install the latest Reportviewer component [2].

Setup – architecture

Using a Report Server

The way to display, preview and print a report that is running on an SQL Server Reporting Services server is by using Internet Explorer. Basically it is one line of code:

METHOD Printen() CLASS dlgBudget
LOCAL cURL AS STRING

// Simple execute of a Report in IE
// assuming a Reporting Services Server in a LAN

cURL := http://yoda/reportserver?/TMPro%20Reports/Budget
ShellExecute(SELF:Handle(),; PSZ("OPEN"),String2Psz(cURL),NULL_PSZ,NULL_PSZ,SW_SHOWNORMAL)

RETURN NIL

All you need is a call to ShellExecute. Now, this runs totally independent of your application, which in many cases is exactly what you need because it allows users to start as many reports as they like and have them side by side etc. If you like to embed the actual report in an application window all you have to do is host the MS-Webbrowser control and Navigate to the same URL as above.  Only the last bit of the URL is different for each report (Report filename) so you will probably have the rest of the URL in a global application setting.

Passing in Parameters.          

Most reports have parameters defined. Note that local reports (to be discussed later) an only use string type parameters so stick to strings. When running reports in IE, all you need to do is add the parameters and their value to the URL. They are case-sensitive by the way!
This is the syntax: &<ParamName>=<ParamValue> so if the above Report had a parameter called ‘Application’ and you want to pass in the value ‘PMOPro 2.8’ the Url would become:

cURL := http://yoda/reportserver?/PMOPro%20Reports/Budget &Application=PMOPro

As you can see in the preview above, this displays the parameter in the preview, if you need to prevent that you can add ‘&rc:PARAMETERS=Collapsed’ to the URL.  Here’s more on msdn regarding what you can do in the URL-request [3] that reporting services supports.

2.Using LOCAL Preview and printing

 Reporting Services comes with a way to run reports completely on the client. This requires the installation of the Reportviewer component [2] and assumes the application will be responsible for accessing the data source and passing that into the component (there is no longer a server to do any processing). This component can easily be embedded in .Net applications and typically those applications connect to the database, generate a .Net DataSet object and pass that to the preview window.

For 32bit environments such as VO it is impossible to use that in this way so we will need to wrap this functionality in a class and expose that using com-interop. Although not overly complex it is a bit of work which is why Software Objectives created the SOReportRuntime component (RDLCPrint.Exe) and a VO-interface class (iSOReportRuntime) to use that. Compared to the above method it needs a bit more information, namely the SQLCommand and the connection string (The server extracts these from the data source and report definition in the Report-server scenario).

Pre requisites

A working Report Server in your LAN, for printing install the latest Reportviewer component [2].

The Software Objectives Report Runtime Component [3]. At this time this is a manual process (because it should be part of the setup/install of the application itself).

Copy RDLCPrint.exe and iSOReportRuntime.* to C:\Program Files\Software Objectives\SOReportRuntime\  and run iSOReportRuntimeLibrary.reg .

Setup – architecture

                Client app (VO) – iSOReportRuntime (COM) – RDLCPRint.Exe (.Net viewer).

Using RDLCPrint

First thing required for using this component from VO is the OLE-Wrapper generated by VO. This code is located in the iSORuntime module in the SOReportRuntime.aef. There are a few test methods and other things in there but the generic methods to use are PrintTo0-20. The number relates to the number of parameters that the Report requires. The reason the interface is like this at the moment is because we have not found a reliable way to pass ragged arrays over com into .net (but we will probably replace this by an XML string in the near future).

The basic code to run a Report using this class is as follows:

oRptParams:XMLSettings is a default XML string that control printer settings like paper, size, margins and start/end page.

Prefixing the name of the printer with the word PREVIEW; triggers the display of the print-preview component.  This allows users to see the report on screen, zoom, page, choose a different printer, change settings and print.

As is obvious form the above code, we have provided a few basic VO classes that wrap the actual iSOReportRuntime class to easily run a report and supply parameters.

3.Direct printing

This is the easy bit, you get this for free because it was implemented in (2). Leave out the PREVIEW; option in the printer name section of the ‘XMLSettings’.

 

Readable links as they appear in the document in case you are working with a printed version.

[1] http://www.Voconversion.com.au/VoConversion/Article%20Archive/Reporting%20Services%20Fasttrack.mht

[2]

http://www.microsoft.com/downloads/info.aspx?na=22&p=2&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=&u=%2fdownloads%2fdetails.aspx%3fFamilyID%3de7d661ba-dc95-4eb3-8916-3e31340ddc2c%26DisplayLang%3den

[3] http://msdn2.microsoft.com/en-us/library/ms153586.aspx