Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CE Scheduled Report processes slowly

Status
Not open for further replies.

mwa

Programmer
Jul 12, 2002
507
US
I have inherited a .Net application that does the following:
Code:
' create the parameter objects
Dim objVal As CrystalDecisions.Enterprise.Desktop.ReportParameterValue
' create a report object
Dim objReport As CrystalDecisions.Enterprise.Desktop.Report
' create an infoobject object and an infoobjects collection
Dim objInfoObjects As CrystalDecisions.Enterprise.InfoObjects
Dim objInfoObject As CrystalDecisions.Enterprise.InfoObject
' set the item id of the enterprise item object to the value of the report
ceeiReport.ItemID = strRpt
' change the type of the enterprise item from infoobject to report and assign it to the report object
objReport = CType(ceeiReport.InfoObject, CrystalDecisions.Enterprise.Desktop.Report)
' create a scheduling object to create a scheduled instance of the report
Dim objSI As CrystalDecisions.Enterprise.SchedulingInfo
objSI = objReport.SchedulingInfo
objSI.RightNow = True
objSI.Type = CrystalDecisions.Enterprise.CeScheduleType.ceScheduleTypeOnce
Dim objFormats As CrystalDecisions.Enterprise.Desktop.ReportFormatOptions
objFormats = objReport.ReportFormatOptions
objFormats.Format = CrystalDecisions.Enterprise.Desktop.CeReportFormat.ceFormatPDF
Next, the code (omitted from here) goes through some gyrations to assign values to the parameter object. Then, it schedules the report:
Code:
ceeiReport.Schedule()
And then it begins querying the CE database waiting for the report to complete:
Code:
Do Until strRunning = "3"
strQuery = "select * From CI_INFOOBJECTS Where SI_PROGID = 'CrystalEnterprise." & strSI_PROGID & "' and SI_ID = '" & objReport.Properties("SI_NEW_JOB_ID").ToString & "'"
objInfoObjects = ceidUser.InfoStore.Query(strQuery)
strRunning = objInfoObjects.Item(1).SchedulingInfo.Properties.Item("SI_PROGRESS").ToString
OneSecondDelay()
Loop
Once the report completes successfully, the query finds the finished report and returns it to the code to be displayed as pdf:
Code:
Dim objExport As CrystalDecisions.Enterprise.Desktop.Pdf
objExport = CType(objInfoObject, CrystalDecisions.Enterprise.Desktop.Pdf)
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = objExport.MimeType
Response.BinaryWrite(objExport.ByteStream)
objExport.Dispose()
Response.Flush()
Response.Close()
Everything is working correctly, in that the page loads and the pdf is displayed. My problem is that the pdf takes about 3 minutes to display. I have debugged the code and found that the hang up is in CE. I can log into Crystal Management Console, navigate to the Reports History tab and see the instance of the report that has been created by this code. It sits there in "Pending" status for about 3 minutes. Then, the status switches to "Running" for a few seconds. Then it switches to "Success" when it is complete. Immediately after completion, the pdf displays in the browser as expected.

Does anyone have any idea why the scheduled job hangs in "pending" status for so long?

Thanks in advance...

mwa
<><
 
I figured this out... Just in case anyone has the same issue in the future... Check the internal clocks of the Web Server and the Crystal Enterprise Server. They need to be in synch. In my case, the CE server was about 3 minutes behind the Web server, thus causing a 3 minute delay.

mwa
<><
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top