on 03-17-2009 12:48 PM
Deal All,
I have some problem to run my program which containing Crystal Report viewer in client's computer (which do not installed Crystal report)
here are the errorr message that appear from the Add On program
"ActiveX component can not create Object"
this message will appear when user connecting my Add On trough Add On Manager
Is there any problem with the Code?
or should I install Crystal Report on client's computer ?
Thank a lot before
Arie
SDK Beginner
Hi 4rie,
You need to install the Crystal Reports Runtime files.
Regards,
Vítor Vieira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mr Vieira,
I already install Crystal Report Runtime files, and the message dissapear..
but another problem comes.. there ar eanother errorr message appear :
"Class doesn't not support automation or doesn't support expected interface "
Is it because using activex class id from VB 6 ?
But it works on my laptop ...
Here are code that I use to view Crystal Report from UI
Public Sub GenerateReport(ReportFile as String)
Dim CP As SAPbouiCOM.FormCreationParams
Dim fTree As SAPbouiCOM.Form
Dim AcXTree As SAPbouiCOM.ActiveX
Dim oItem As SAPbouiCOM.Item
Dim i As Integer
Set CP = oApplication.CreateObject(cot_FormCreationParams)
CP.BorderStyle = SAPbouiCOM.BoFormBorderStyle.fbs_Sizable
CP.FormType = "ACXTree"
CP.UniqueID = "ACTree1"
Set fTree = oApplication.Forms.AddEx(CP)
fTree.Left = 10
fTree.Top = 10
fTree.Width = 1150
fTree.Height = 660
fTree.Title = "Crystal Report Form"
fTree.AutoManaged = True
' Add the TreeView Control to the form
Set oItem = fTree.Items.Add("Tree", SAPbouiCOM.BoFormItemTypes.it_ACTIVE_X)
oItem.Left = 1
oItem.Top = 1
oItem.Width = 1142
oItem.Height = 630
' Create the new activeX control
Set AcXTree = oItem.Specific
Dim CRApp As New CRAXDDRT.Application
Dim CRRep As CRAXDDRT.Report
'CreateObject("CrystalRuntime.Application")
Set CRRep = CRApp.OpenReport(ReportFile)
AcXTree.ClassID = "CrystalReports12.ActiveXReportViewer.1"
Dim oTreeView As CrystalActiveXReportViewerLib12Ctl.ICrystalReportViewer11
Set oTreeView = AcXTree.Object
oTreeView.EnableToolbar = True
oTreeView.EnableStopButton = True
oTreeView.EnableSelectExpertButton = True
oTreeView.EnableSearchControl = True
oTreeView.EnableRefreshButton = True
oTreeView.EnableProgressControl = True
oTreeView.EnablePrintButton = True
oTreeView.EnablePopupMenu = True
oTreeView.EnableGroupTree = True
oTreeView.DisplayGroupTree = True
oTreeView.ReportSource = CRRep
oTreeView.ViewReport
' Make the form visible
fTree.Visible = True
What makes it stilll errorr on client computer like that ?
4rie,
I code very little ActiveX controls into my B1 add-on, but I'm almost certain that you need to set the ActiveX ClassID when you create it, which you are not doing.
AcXTree = oItem.Specific
AcXTree.ClassID = "MSComctlLib.TreeCtrl.2"
oTreeView = AcXTree.Object
Please take a look at the ActiveX SDK Sample and see what you're doing wrong.
Also, I open my Crystal Reports in a .NET form, not a B1 form...
Regrads,
Vìtor Vieira
Mr Vieira,
I have already try your Code replacing mine...
... but when it steps to code " oTreeView = AcXTree.Object" system raised error message "Type Mismatch "
Can I know how you declare oTreeView ?
I declare oTreeView as "Dim oTreeView As CrystalActiveXReportViewerLib12Ctl.ICrystalReportViewer11"
Is it already correct ?
And is that problems when I use VB6 instead of VB .Net ?
Many Thanks Before
Arie
Hi 4rie,
The code I provided is just a sample taken from the SDK code samples.
AcXTree.ClassID = "MSComctlLib.TreeCtrl.2"
The above ClassID is for a TreeControl. You need to search you registry for the correct ClassID for the control you're trying to instantiate (CrystalActiveXReportViewerLib12Ctl.ICrystalReportViewer11).
If other words, different controls have different ClassID's. You can see the ClassID as you're controls digital signature. With out it, the application won't recognize the control neither it's objects/methods...
Regards,
Vítor Vieira
Hello,
We are trying to do the exact same thing you did i.e. open a crystal report using the SDK. After trying the code from the forum, we are still facing some issues running the code succesfully.
Would really appreciate it if you could share with us how you have managed to open a vb form with crystal reports?
Thanks.
Hi ,
Go to this Link http://www.macropool.com/en/download/scripting.html
and flow the instraction over there .
i hope it will solve your prob
Thanks
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.