Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports, version for Visual Studio
Viewing all articles
Browse latest Browse all 2556

Crystal Reports - Export as PDF to stream - The system cannot find the path specified

$
0
0

Hi,

 

I'm running a C# .NET application on Windows Server 2012 R2 with .NET Framework 4.5. This application depends on the Crystal Reports runtime engine for .NET Framework 4.

 

After setting up my report (initialising object, loading .rpt file, setting database connection details, passing parameters), I am then exporting this report to a stream, then copying to a memory stream.

 

MemoryStream memoryStream = new MemoryStream();
Stream exportStream = crystalReport.ExportToStream(ExportFormatType.PortableDocFormat);
exportStream.CopyTo(memoryStream);

This process hangs for a minute or so before producing this exception/stack trace

System.Runtime.InteropServices.COMException (0x80004005): The system cannot find the path specified.

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

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

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

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

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

I've checked the permission of the .rpt file it uses and it has permission to read these files for the user the process is running as.

 

I've also confirmed that the user has permission to read/write to "%temp%" which resolves to "\AppData\Local\Temp\1" for that user. As the code is executed it writes 4 files to this location, before cleaning up 3 of them as the exception is thrown. One empty file remains.

 

I've reinstalled/repaired both the 32 and 64 bit editions of the runtime, and have also installed the Microsoft Visual C++ 2005 redistributables including the security updates. I did not receive any DLL registration errors while installing on this server (though have in previous deployments which were missing the dependencies).

 

I'm at a loss as to where to look into next. Any help would be appreciated.

 

Thanks,

Brent.


Viewing all articles
Browse latest Browse all 2556

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>