ReportDocument.load causes ASP.NET Error: This application has requested...
I have a ASP.NET Web application written in Visual Studio 2008. The web page exports a Crystal Report to a PDF File. At run time when the export button is pressed, the code runs sucessfully first time producing the PDF file. However, if I click the button 2nd time, I get this error:
Microsoft Visual C++ Runtime Library
This applicaiton has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Note: I am using crystal report engine to export the report and this code was running without any error in Dot Net framework 1.1. When I upgraded to VS 2008, the objects where changed to Crystal 10.5 that comes with Visual Studio 2008, and the framework is upgraded to 2.0. Since then, the report prints first time and exits abornally with the error message shown above after that.
1. Error does not occur at all when running the application directly from VS2008 IDE.
2. Error does not occur when running the application first time from I.E. When I run the application 2nd time, I get the error.
3. The error occurs exacly when REPORTDOCUMENT.LOAD is called.
4. I am correctly calling the methods to dispose the report in PAGE.UNLOAD event as follows:
5. I have so far un-installed and re-installed all the Dot Net frameworks on my laptop. I have also isolated the problem by creating a standalone sample application and I get the same error. When running the applicaiton from VS2008 , there are no errors. But when running directly from IE, first time the report works , 2nd time I get the same error as mentioned in this thread.