Crystal Reports Error

G

Guest

Hi,

I've got an intermittent problem with one of my ASP.NET database and
reporting applications that I developed with Visual Studio .NET 2003. I'm
using the Crystal Reports components integrated into VS.NET. To display a
selected report my code
1. fills a dataset
2. sets the data source of my strongly typed report to the filled dataset
3. exports the report to a memory stream
4. writes the stream into the Response

Here is an example of the VB.NET code:
'*** Beginning of sample code
Dim oRpt As New MyReportClass
Dim oStream As New MemoryStream

SqlDA_MyDataAdapter.Fill(dsMyDataset, "MyTable")

oRpt.SetDataSource(dsMyDataset)

oStream =
oRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)

Response.Clear()
Response.Buffer = True
Response.ContentType = "application/pdf"
Response.BinaryWrite(oStream.ToArray())
Response.End()
'*** End of sample code

The error I get when the report is requested is:
Exception Details: System.IO.IOException: The process cannot access the file
"C:\DOCUME~1\CYPRES~1\IWAM_W~1\LOCALS~1\Temp\export_47ab5362-8c19-4653-aaab-da2163d3c318.tmp" because it is being used by another process.

Any suggestions?

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top