views:

553

answers:

3

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?

A: 

Try this

abmv
A: 

Remove the try-catch block.

MGOwen
A: 

Hi Sauron,

       Can you tell me how you solved this problem ? You don't have any response.redirect in your code to put false in the second argument. You are exporting report to response right ? So how did you resolve this exception ?

Thanks

Aarkay