Exception on dowloading Pdf file in ASP.NET

Posted by Sauron on Stack Overflow See other posts from Stack Overflow or by Sauron
Published on 2009-06-09T11:17:15Z Indexed on 2010/05/07 16:18 UTC
Read the original article Hit count: 439

Filed under:
|
|

I am downloading a Pdf file created by crystal report and I download as

 ReportDocument repDoc = ( ReportDocument ) System.Web.HttpContext.Current.Session["StudyReportCrystalDocument"];
        // Stop buffering the response
        Response.Buffer = false;
        // Clear the response content and headers
        Response.ClearContent();
        Response.ClearHeaders();
        try
        {    
            repDoc.ExportToHttpResponse(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, Response, true, "StudyReport" );
        }
        catch( Exception ex )
        {
        }

Eventhough it is working But I got an exception

base {System.SystemException} = {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

Can anyone explain what is the reason for this and how to override the exception?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about pdf