cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Can't close Reportdocument class

Former Member
0 Likes
1,595

Hi all,

Imagine this simple piece of code:

Dim RptDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument

RptDoc.Load("C:\Report1.rpt")

RptDoc.PrintToPrinter(1, False, 1, 0)

RptDoc.Close()

RptDoc.Dispose()

Report1.rpt is a simple report with a label and no DB connection (just for a try)

When tryng to process RptDoc.Close system hangs (i always stopped so i don't know how long it can take to close)

Same issue with Using / End Using

Using RptDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument

RptDoc.Load("C:\Report1.rpt")

RptDoc.PrintToPrinter(1, False, 1, 0)

End Using

I'm woking with VS2010 and CR 13

Normally miy reports have a DB connection to Oracle but wanted to see if the close also fails with a very simple report and it does !

Any ideas ?

View Entire Topic
Former Member
0 Likes

I know exactly where it hangs - on RptDoc.Close - after printing

This happens on any printer

Also tried to add a viewer on a form:

Dim RptDoc As New CrystalDecisions.CrystalReports.Engine.ReportDocument

RptDoc.Load("C:\Report1.rpt")

Dim oFrm As New Form1

oFrm.CrystalReportViewer1.ReportSource = RptDoc

oFrm.ShowDialog()

oFrm.Dispose()

RptDoc.Close()

RptDoc.Dispose()

The report shows correctly but then VS hangs on RptDoc.Close

Edited by: gwadafu on Jan 5, 2011 5:07 PM

former_member208657
Active Contributor
0 Likes

It might help you to turn on some of the logging to see what the reporting engine is doing when attempting to close the connection. Have a look at the kbase article below for instructions on how to turn on the logging. Analysis of the logs will be up to you though. You'll want to look at the logs backwards though. Check for things that take an extraordinarily long time to complete in the functions log.

This was just published to the public today so it may take 24 - 48 hours to be available in the search.

1470978 - How to enable/disable crpe logging for the Crystal Reports .NET SDK