Dev Direct Solution Center

For more information and to buy this product...

Embedded Reporting Component

  For a copy of the sample project please click here to download and install the product evaluation.

Introduction

This system allows programmers to add a very powerful database query/report designer to their own applications. Simply clone the sample code into your own code and having deployed all the required files via our installer you have a ready made reporting tool.

Detail

Embedded Query Component

The system is aimed at software developers who want a shrink wrapped reporting solution. The installer deploys all the dll/ocx files to the end-users system32 directory and you clone the sample code we provide into your own application. The reporter is invoked by clicking a toolbar button or by what-ever means you desire.

The dba/programmer also has a different admin EXE to use prior to live deployment to the end-users. This admin system enables the administrator to set up access to 10 differents database types for users of their own application. Users are members of groups and each group is granted access to tables, views and stored procedures (Stored Procedures is the new feature in version 3.9.1)

There are several types of query screens for the end-users ranging from being to select tables/fields and relationships to being only able to execute views and procedures. The type of screen each user will see is controlled by the admin suite.

The screen that lists the stored procedures allows the end-user to double-click on the procedure name and then they are presented with another screen asking for the value for each procedure parameter. So if you only currently use procedures to for manipulation purposes then you can now create new procedures to act like views with the added benefit of parameters to limit the data returned.

So once all the meta-data has been set-up by the dba/programmer then the mandatory files can be deployed via our installer in login scripts for example and you also deploy your own changed application that references the main query component dll and has the cloned code within.

The system is downloadable from our web-site as a 126MB zip file containing:

  • Administration installation folder - installs a EXE on DBA's PC
  • End user installation folder - installs the DLL/OCX files in system32
  • RPC server installation folder - installs a RPC service on a network server PC
  • Sample code folder - VB6, Delphi and dotNet

The sample code provided here is in VB6

Visual Basic Sample Code
Option Explicit

Withevents as you need to detect if the user has loaded/unloaded our component for button re-enablement
Private WithEvents tEmbeddedServer As xReport

Private Sub Form_Load()

If Not Exists(g_sSystemDirectory & "\xEmbeddedServer.dll") Then
    MsgBox "CrossCompass Embedded Server DLL missing from " & g_sSystemDirectory, vbCritical, "DemoSample"
    End
End If

Set tEmbeddedServer = New xReport

tEmbeddedServer.ParentApplication = "YourAppName"  ' The name you want to display
tEmbeddedServer.ApplicationType = "STANDARD"
tEmbeddedServer.ApplicationInfo = vbNullString
tEmbeddedServer.ApplicationLeft = 200
tEmbeddedServer.ApplicationTop = 750
tEmbeddedServer.ApplicationProtocol = "Com"        ' or .NET
tEmbeddedServer.ApplicationUser = vbNullString     ' Use Windows userid
tEmbeddedServer.ApplicationCompany = vbNullString  ' Bespoke per company if required
tEmbeddedServer.TabsOnTop = True                   ' XP style Tabs position
tEmbeddedServer.ShowProgress = False               ' Show Progress window
tEmbeddedServer.DebugMode = False

Start the component to check all is OK
If Not tEmbeddedServer.StartReporter Then ' allow the user to invoke the server
    tbrMain.Buttons(3).Enabled = False
    MsgBox tEmbeddedServer.GetLastError.Source & " at line " & tEmbeddedServer.GetLastError.LineNumber & ") -" & tEmbeddedServer.GetLastError.Number & ", " & tEmbeddedServer.GetLastError.Description
    Exit Sub
End If

End sub

Following code maybe the main toolbar of your application
Private Sub tbrMain_ButtonClick(ByVal Button As MSComctlLib.Button)

    Select Case Button.Key
    
        Case "Open"
            MsgBox "This button opened something in your application", vbInformation, "EmbeddedSample"

The button that will load the reporting suite
        Case "SQL"
            
            tbrMain.Buttons(3).Enabled = False
            
            If Not tEmbeddedServer.ShowReportScreen Then
                tbrMain.Buttons(3).Enabled = False
                MsgBox tEmbeddedServer.GetLastError.Source & " at line " & tEmbeddedServer.GetLastError.LineNumber & ") -" & tEmbeddedServer.GetLastError.Number & ", " & tEmbeddedServer.GetLastError.Description
                Set tEmbeddedServer = Nothing
                Exit Sub
            End If
            
        Case "Help"
            MsgBox "This button showed the end-user some help file", vbInformation, "EmbeddedSample"
   
    End Select

End Sub

Detect if the user has ended the query session and re-arm your button
Private Sub tEmbeddedServer_ServerUnLoaded(UnLoaded As Boolean)

If UnLoaded Then
    tbrMain.Buttons(3).Enabled = True
End If

End Sub

Destroy any reference to our component when your application is finished
Private Sub Form_Unload(Cancel As Integer)
    Set tEmbeddedServer = Nothing
End Sub
Visit CrossCompass Ltd for more information and more samples.