Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1963 closed Bug (Duplicate)

Ticket 1658 Still Not Working in

Reported by: mejonah@… Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


This (closed, fixed) ticket:

still seems to be a problem in when using Crystal Reports (11) via COM. I wasn't sure whether to comment in the initial thread or start a new one, so sorry if I chose incorrectly.

The code below properly opens the report in, but causes a COM "member not found error" on the line $CR_ObjViewer.ReportSource = $CR_ObjReport (commented in the code).

#Region ; Directives created by AutoIt3Wrapper_GUI
#EndRegion ; Directives created by AutoIt3Wrapper_GUI
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Initialize a COM error handler

Func MyErrFunc()

Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _

"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _


Local $err = $oMyError.number
If $err = 0 Then $err = -1

$g_eventerror = $err ; to check for after this function returns


$gui = guicreate("TEST", 500, 500)

$sReportName = FileOpenDialog("Select RPT Source File", ".", "RPT (*.rpt)", 3)

if $sReportName <> "" and fileexists($sReportName) then

$CR_ObjApp = ObjCreate("CrystalRuntime.Application.11")
If $CR_ObjApp = 0 Then

msgbox(0, "Error", "Crystal Reports is not installed.", default, $gui)


$CR_ObjReport = $CR_ObjApp.OpenReport($sReportName)
If $CR_ObjReport = 0 Then

msgbox(0, "Error", "Unable to open report.", default, $gui)


$CR_ObjViewer = ObjCreate("CrystalReports11.ActiveXReportViewer.1")
$CR_ObjViewer.DisplayGroupTree = true

;Creates an ActiveX control in the GUI.
$ActiveX = GUICtrlCreateObj ( $CR_ObjViewer, 10, 10, 480, 480)

$CR_ObjViewer.ReportSource = $CR_ObjReport ;this line causes a COM error "member not found" in beta, but not in earlier non-beta versions




Of course CR must be installed, here is a thread discussion on it:

Attachments (0)

Change History (3)

comment:1 Changed 13 years ago by Jon

  • Resolution set to Duplicate
  • Status changed from new to closed

comment:2 Changed 12 years ago by mejonah@…

This was closed out as a duplicate (since I referred to the other thread which I thought was the same), but it must be different because the example I posted above still does not work in

comment:3 Changed 12 years ago by anonymous

Moved info over to original Ticket.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.