E
I’m stuck. I finally gave in and decided to learn Crystal Reports for use with various HMI applications. Ultimately I would like to develop a standard set of reports that we can use for all of our HMI applications. With the push to connect SCADA networks to the enterprise, Crystal seems to be the report package of choice. I have started out with 8.5. I have spent several hours on the phone with Seagate Software and have learned that they want you to use their new ActiveX object “Crystal Report Viewer Control”. I cannot get it to work. The .ReportSource method fails. I can get the older OCX object “Crystal Report Control” to work, but this opens the report in a separate window not imbedded in the screen. I can also get compiled reports to work, but you cannot automatically pass parameters to them at runtime. I have also been told by Seagate that these two methods will not be supported in the future. I have been working with Cimplicity HMI because that’s the HMI package I have the most experience with. If I can get it to work with Cimplicity, I don’t think I’ll have to much trouble porting it over to RSView, etc. (always the optimist!)
The following is a the script that should run to select and view the report C:\Report\HMIReport.rpt. In an effort to debug I have used break points and dialog boxes. I have determined that everything works fine except for: “cimOleObj.ReportSource = Report”. I am not the greatest VB programmer, but this doesn’t seem like rocket science. There has to be some little thing I’m doing wrong. Any suggestions?
Private cimOleObj As CRVIEWERLib.ICrystalReportViewer4
Sub Preview()
Dim Report As Object
Dim CSApplication As Object
Set Report = CreateObject("CrystalRuntime.Report")
Set CSApplication = CreateObject("CrystalRuntime.Application")
Set Report = CRApplication.OpenReport("C:\Report\HMIReport.rpt")
cimOleObj.ReportSource = Report
cimOleObj.ViewReport
End Sub
The following is a the script that should run to select and view the report C:\Report\HMIReport.rpt. In an effort to debug I have used break points and dialog boxes. I have determined that everything works fine except for: “cimOleObj.ReportSource = Report”. I am not the greatest VB programmer, but this doesn’t seem like rocket science. There has to be some little thing I’m doing wrong. Any suggestions?
Private cimOleObj As CRVIEWERLib.ICrystalReportViewer4
Sub Preview()
Dim Report As Object
Dim CSApplication As Object
Set Report = CreateObject("CrystalRuntime.Report")
Set CSApplication = CreateObject("CrystalRuntime.Application")
Set Report = CRApplication.OpenReport("C:\Report\HMIReport.rpt")
cimOleObj.ReportSource = Report
cimOleObj.ViewReport
End Sub