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