on 09-24-2008 7:16 PM
I have been looking over Code Samples, Help Forums and documentation from Business Objects for pas 5 hours. I made this work with VS2003 and CR10 but now im running VS2005 with CR2008.
Here is my code; It crashes on the bold line with the message: "Invalid cast".
The report is there and valid.
It does not even connect to a database; it has one text field in the header containing "Helloworld"
Oh and one more thing; i dont have this class CRAXDDRT. Im assuming that the class was stopped at CR11...
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class cCRViewer
Protected oForm As SAPbouiCOM.Form
Protected oDataSources As SAPbouiCOM.UserDataSources
Protected WithEvents oCRViewer As CrystalActiveXReportViewerLib12.CrystalActiveXReportViewer
Public ocr As New ReportDocument
Public Sub New()
Dim oActiveX As SAPbouiCOM.ActiveX
Dim oItem As SAPbouiCOM.Item
Try
oForm = oApplication.Forms.Add("NewClass", SAPbouiCOM.BoFormTypes.ft_Sizable, "900201")
oDataSources = oForm.DataSources.UserDataSources
oItem = oForm.Items.Add("Viewer", SAPbouiCOM.BoFormItemTypes.it_ACTIVE_X)
oActiveX = oItem.Specific
oActiveX.ClassID = "CrystalReports12.ActiveXReportViewer.1"
oCRViewer = oActiveX.Object
ocr.Load("D:\TEST.rpt")
oCRViewer.ReportSource = ocr
oForm.Visible = True
Catch ex As Exception
End Try
End Sub
Thanks
Denis
Edited by: Denis Doiron on Sep 24, 2008 8:17 PM
Edited by: Rui Pereira on Dec 23, 2008 2:44 PM
Please guys, I really would appreciate some help if anyone has used the New activeX Viewer from Crystal 2008.
thanks,
Denis
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.