sql report to HMI display

go_bears

Member
Join Date
Feb 2009
Location
South Dakota
Posts
28
Hi everyone, I am trying to put a sql server report on an HMI display without having to open internet explorer. I am using RSVeiw SE 5.0. Any suggestions would be great. Thanks
 
That's what I was thinking I was going have to do. I am not that familiar with VBA. I will look into how to do that. Thanks for the help. I think we are using Microsoft Reporting Services.
 
Last edited:
Well, for Crystal, and anything that has a component that you can access through VBA, the basics are like this:

1 - Create a display.
2 - Put a button on it, right click button, select Property Panel, then under 'Expose to VBA', select "VBA Control.
3 - Right click it again, select "VBA Code"
4 - In the VBA Editor, go to Menu | Tools - References.
5 - Check off the following (if using Crystal):
Code:
     Visual Basic for Applications
     RSView Display Client Object Model
     Microsoft Forms 2.0 Object Library
     Microsoft ActiveX Data Objects 2.6 Library (or appropriate)
     Microsoft OLE DB Service Component 1.0 Type Library (or appropriate)
     Crystal Reports Report Viewer Control (I use vers 9)
     Crystal Reports 9 ActiveX Designer Run Time Library (for dynamic forms and such if needed).
6 - For that display, in the upper left, right click "DisplayCode", and insert a new userform. Double click it to open it.
7 - Back to menu - View | Toolbox (These are Windows Forms controls)
8 - Back to the menu - Tools | Additional Controls - Check off Crystal Viewer 9 (in my case), and any others you might want. They will appear on the toolbox.
9 - Select the report viewer from the toolbox, and place one on the form. Size how you like.
10 - Play with some options on the properties box, name it "crViewer" so it works with the code below.
11 - Add a Windows button to populate your form, attach code similar to this:
Code:
Private Sub cmd_ShowReport_Click()

Dim crApplication As CRAXDRT.Application
Dim crReport As CRAXDRT.Report
On Error GoTo ErrHandler
'Create an instance of the RDC engine
Set crApplication = New CRAXDRT.Application

'Open the Formula Report
Set crReport = crApplication.OpenReport("MyReport.rpt", 1)

'Attach the Report Viewer control to the report to view
crViewer.ReportSource = crReport
    
'Set Selection Criteria for the Report
crReport.RecordSelectionFormula = "{tbl_Table.SelectionField} = 12345" ' Modify as needed or populate from form field.
       
'Display the report in the Viewer
crViewer.ViewReport

'Refresh the viewer to force update    
crViewer1.Refresh

Exit Sub
ErrHandler:
    LogDiagnosticsMessage Err.Number & " " & Err.Description & " in cmd_ShowReport_Click()", ftDiagSeverityInfo

End Sub
Those are the basics.
 

Similar Topics

Goodevening all... I have a Redlion PTV and Graphite with built in webserver... I can create the simple default.htm page... drag in tags to...
Replies
1
Views
1,912
I have a requirement to produce date-range selectable reports from a panel mounted PC running FactoryTalk View SE. So far I have FactoryTalk...
Replies
0
Views
2,125
Hi guys, I use WinCC 6.0 I have database in which i put informations about shifts. I have a window in which operator can see those informations...
Replies
0
Views
4,688
Hi all, I'm having difficulties trying to connect FactoryTalk View SE Local Station (V13.00) to MS SQL Server Express. I state that they are...
Replies
2
Views
158
Hi all, I have FTV v13 installed on my VM. I made an ME application and exported it in v11, as that's the version being used on the Panelviews at...
Replies
3
Views
412
Back
Top Bottom