Skip to Content
Former Member
May 01, 2012 at 07:32 AM

Random LogOnException errors with ExportToStream



We have several reports created on Crystal for Visual Studio 2008, which were migrated to VS2010. We run then on a web server (IIS7, WS2008 32 bits) on framework 4.0.

We use ExportToStream to generate PDF versions of the reports, and they run fine.

But from time to time, no clear cause (apparently not related to load, concurrent users or number of reports created), we receive errors like this:

CrystalDecisions.CrystalReports.Engine.LogOnException: Can’t connect to the database. ---> System.Runtime.InteropServices.COMException: Can’t connect to the database.

in CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)

in CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

--- Inner exception ---

in CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e)

in CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)

en CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)

en CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)

en CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)

after this error, no other reports can be generated. Temporary report on TEMP directory is created and everything else on our app runs fine.

Only solution is an iisreset, that gets reports running, but after some time, same happens, tried SP1, SP2 and SP3 of Crystal for VS2010

Any idea on how to deal with this?

Best regards,