Modify

Opened 14 years ago

Closed 13 years ago

Last modified 13 years ago

#1963 closed Bug (Duplicate)

Ticket 1658 Still Not Working in 3.3.7.10

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

Description

This (closed, fixed) ticket:
http://www.autoitscript.com/trac/autoit/ticket/1658

still seems to be a problem in 3.3.7.10 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 3.3.6.0, 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
#AutoIt3Wrapper_UseX64=n
#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

Endfunc

$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)

else

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

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

else

$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 3.3.7.10, but not in earlier non-beta versions
$CR_ObjViewer.ViewReport

endif

endif

endif

Of course CR must be installed, here is a thread discussion on it: http://www.autoitscript.com/forum/topic/12813-crystal-reports-viewer-in-autoit/

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 13 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 3.3.7.18.

comment:3 Changed 13 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

Action
as closed The ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.