Hi everyone, I am wondering if anyone has experienced this issue before. I am using the following code print a custom Crystal Report. The problem is from time to time, running the report ends up in a Not Responding State:
So basically most of the time the report is printed but sometimes it freezes in a Non Responding State.
Would anyone have an idea?
Code:
On Error GoTo ACCPACErrorHandler
Dim mDBLinkCmpRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READWRITE)
Dim mDBLinkSysRW As AccpacCOMAPI.AccpacDBLink
Set mDBLinkSysRW = OpenDBLink(DBLINK_SYSTEM, DBLINK_FLG_READWRITE)
Dim rpt As AccpacCOMAPI.AccpacReport
Set rpt = ReportSelect(reportPath, " ", " ")
Dim rptPrintSetup As AccpacCOMAPI.AccpacPrintSetup
Set rptPrintSetup = GetPrintSetup(" ", " ")
If rptPrintSetup.Destination = PD_PRINTER Then
rptPrintSetup.query (0)
End If
rpt.PrinterSetup rptPrintSetup
rpt.SetParam "@SELECTION_CRITERIA", val
rpt.NumOfCopies = 1
rpt.PrintDir = ""
rpt.PrintReport
Set mDBLinkCmpRW = Nothing
Set mDBLinkSysRW = Nothing
Set rpt = Nothing
Set rptPrintSetup = Nothing
So basically most of the time the report is printed but sometimes it freezes in a Non Responding State.
Would anyone have an idea?