This is a migrated thread and some comments may be shown as answers.

Third party Export not working on Item Command event

1 Answer 108 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Naresh Goradara
Top achievements
Rank 2
Naresh Goradara asked on 06 Jul 2010, 07:42 AM
Hi,
I am using Q1 2010 AJAX ASP.Net controls for development.

I have one RadGrid placed on page, and on ItemCommand event i am exporting crystal report to pdf (working with response) then it gives me an error like:
{Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}

One thing to be note is that same is working on any event of asp control.
This happens when I use RadAjaxManager in my page.
My code for same is as below:
// Get the report document 
        CrystalDecisions.CrystalReports.Engine.ReportDocument repDoc = GetReportDocument(); 
        // 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, false"Invoice"); 
            
        } 
        catch (System.Threading.ThreadAbortException ex1) 
        { 
            ex1 = null
            Response.End(); 
        } 
        catch (Exception ex) 
        { 
            ex = null
        } 
        finally 
        { 
        } 

Please suggest to overcome this issue.

With Regards,
Naresh Goradara

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 08 Jul 2010, 09:40 AM
Hi Naresh,

You need to make sure that AJAX is turned off while exporting is taking place, because the grid prepares additional information when performing export operation. This information cannot be passed through the XMLHttpObject used for AJAX requests. Here is a link to a help topic with tips on how to turn AJAX off while exporting.

Kind regards,
Tsvetina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Naresh Goradara
Top achievements
Rank 2
Answers by
Tsvetina
Telerik team
Share this question
or