cancel
Showing results for 
Search instead for 
Did you mean: 

.net application displaying report as pdf from CE runs slowly

Former Member
0 Kudos

I have inherited a .Net application that does the following:


' 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:


ceeiReport.Schedule()

And then it begins querying the CE database waiting for the report to complete:


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:


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.The report itself only takes a few seconds to load in the Crystal Reports designer, or when run manually through the Crystal Management Console. I have debugged the code and found that the hang up is in CE scheduler. 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? Is there a setting in CE that needs to be changed?

Thanks in advance...

Mitch

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Mitch,

Since the report is sitting in Pending status for 3 minutes after it's scheduled you might check the time on the web app server and the Enterprise server to see if they're in synch. If not, synch them back up and check the Pending behavior.

Sincerely,

Dan Kelleher

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks!!!

The CE Server and the Web Server internal clocks were out of synch! The CE server was about 3 minutes behind the Web Server. I never even considered that. Once we corrected the time on the CE Server, the report now displays in pdf in less than 10 seconds.

Thanks for your help!

Mitch

0 Kudos

Hi Mitch,

What version are you using and at what patch level have you installed?

If you schedule this report in Enteprise how long does to take? It may depend on the report itself. You can put tracing on the JobServer, stop the Job Server in CCM, and add this to the end of the command line:

-trace -crpetrace 7

Re-start the Job Server. The logs are in the logging folder under Businessobjects Enteprise. Now shedule the report through your app and if it runs fast in Info View also capture those logs.

Don't forget to remove the tracing commands or it will fill up your hard drive.

Have a look at the logs, please don't copy and paste all of the logs into this thread. It may be quicker if you log a case in Service Market Place and have a dedicated engineer assist you.

Thank you

Don