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

RADGrid Export to CSV/Excel - Content Disposition

3 Answers 274 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jens Olesen
Top achievements
Rank 1
Jens Olesen asked on 22 Oct 2009, 07:10 AM
I have a problem with CSV / Excel-export from RADGrid (Q2 2009).

At my customers site, the export ends up as an Excel appl. completely embedded in the browser window.
The browser window is a RadWindow ... so I end up with an Excell sheet I cannot control at all (no menus).

If I access the site from my own PC, Excel is started as a standalone application - and my customer wants that as well.
I am pretty sure I could solve the problem if I was Administrator on the site (although I dont know yet exactly where to change which setting).

In other areas of the application I have coded my own CSV Export - and it works as the customer wants (Standalone Excel).

I have grabbed the HTTP Response headers from the RadGrid-Export, and found this:
"Content-Disposition: inline;filename="%52%61......"
and this:
Content-Type: application/vnd.ms-excel

In my own CSV-export I use this:
Response.AppendHeader("Content-Disposition", "attachment;filename=Job.csv")
Response.ContentType = "application/download"

Is there somehow a possibility that I can change the way RadGrid does the export ?

Thanks

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Oct 2009, 03:30 PM
Hello Jens,

Could you please try to set ExportSettings-OpenInNewWindow="true"?
<telerik:RadGrid ID="RadGrid1" runat="server" ...
    <ExportSettings OpenInNewWindow="true" ...

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jens Olesen
Top achievements
Rank 1
answered on 22 Oct 2009, 07:43 PM
Damn' .... I have tried and searched and even used Fiddler2 to see what happened ...

I tested your solution it at the customer site - and it works fine !

Daniel, you've just made my day ;-)


Another question:

I build the filename like this:
RAD_GRID.ExportSettings.FileName = Page.Request.QueryString("Project") + "_HOURS"






The dialog that pops up suggest I can save the file with the filename constructed above, but if I open Excel, this filename is changed to some hexadecimal notation %30%31%35............

Can you tell me why ?

Thanks a lot !

Best regards

Jens (who is smiling all over the face .... ;-))
0
Daniel
Telerik team
answered on 22 Oct 2009, 08:49 PM
Hello Jens,

I'm glad to hear my suggestion is helpful. Regarding the escaped file name - we already fixed this issue - I recommend you try the latest version of RadControls for ASP.NET AJAX

Let me know if you need more information.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Jens Olesen
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Jens Olesen
Top achievements
Rank 1
Share this question
or