Export button does not work in IE8

15 posts, 0 answers
  1. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 22 Aug 2011 Link to this post

    SOS!
    I suddenly bumped into weird problem. When I click export button (pdf, excel) on my grid - I am getting this:



    Everything works properly in other browsers and in IE9...

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Aug 2011 Link to this post

    Hello Alexander,

    Please take a look into the following article which explains the similar issue.
    Internet Explorer is unable to open Office documents from an SSL Web site.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 22 Aug 2011 Link to this post

    Hi, Shinu.

    Uhhm... I have not checked such approach, but I cannot use ViewState in any case, because I use client-side grids and receive data via web-services: i call web-service, get data from the db, save it in session and when i click export button - data is retrieved from the session... :(
  5. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 24 Aug 2011 Link to this post

    Hello Alexander,

    Please note that exporting with client-side binding is not supported, RadGrid should be bound server-side, otherwise you will receive an empty file.

    You can refer to this help topic for additional information.

    Regards,
    Mira
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  6. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 25 Aug 2011 Link to this post

    Greetings,

    yes, I know this. I use postback for exporting and get data, that is stored to session in webservice call, it works in general and data is ok.
    The problem concerns only IE8, because of this security stuff, as I am being told...
  7. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 30 Aug 2011 Link to this post

    Hello Alexander,

    I assume that the issue is caused by using the export feature over SSL and Internet Explorer.
    Please try adding the following lines just before the exporting:
    RadGrid1.Page.Response.ClearHeaders();
    RadGrid1.Page.Response.Cache.SetCacheability(HttpCacheability.Private);

    If the problem persists, you can toggle the value of the OpenInNewWindow property.

    I hope this helps.

    Greetings,
    Mira
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  8. Paul
    Paul avatar
    7 posts
    Member since:
    Jul 2012

    Posted 03 Jul 2012 Link to this post

    I am experiencing this same problem.  I have added the 2 lines to clear the headers and SetCacheability(HttpCacheability.Private) to no avail.  Also, I tried toggling the OpenInNewBrowser flag and that did not work either.  
  9. Mikhail
    Mikhail avatar
    5 posts
    Member since:
    Oct 2011

    Posted 04 Jul 2012 Link to this post

    Hello.
    We have the  same issue. Please help resolve this problem. We use provided by you two lines, but problem still exists.
  10. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 05 Jul 2012 Link to this post

    Hello Mikhail,

    Please try using the same code in the GridExporting event.

    Kind regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. Mikhail
    Mikhail avatar
    5 posts
    Member since:
    Oct 2011

    Posted 05 Jul 2012 Link to this post

    When we use this code 
    Reportgrid.Page.Response.ClearHeaders();
               Reportgrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private);
    in Reportgrid.GridExporting error not appear but content goes to client not like xls file but like html page and shows in IE window. 
  12. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 06 Jul 2012 Link to this post

    Hi guys,

    Alternatively you could try the workarounds provided by Microsoft here:
    Internet Explorer file downloads over SSL do not work with the cache control headers

    Regards,
    Daniel
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. Paul
    Paul avatar
    7 posts
    Member since:
    Jul 2012

    Posted 09 Jul 2012 Link to this post

    I am unable to use Microsoft's workarounds.  They involve Registry edits and this is a client-facing website.  When I add the 2 lines to the OnGridExporting event, the text is displayed in the browser as a web page instead of a download.  Are there any other solutions to this problem?
  14. Mikhail
    Mikhail avatar
    5 posts
    Member since:
    Oct 2011

    Posted 10 Jul 2012 Link to this post

    In my case, workarounds provided by Microsoft helped. We exporting grid to Excel. When you using this code:
    Reportgrid.Page.Response.ClearHeaders();
    Reportgrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private);

    you clear Reportgrid.Page.Response.ContentType, try to set it. In my case:
    Reportgrid.Page.Response.ContentType = "application/vnd.ms-excel";

    This helped for me. When file downloaded and if client use Ms Office 2003-07 all ok but if client use Office 2010 client take error to open downloaded file.
  15. Paul
    Paul avatar
    7 posts
    Member since:
    Jul 2012

    Posted 10 Jul 2012 Link to this post

    I was able to get this working by inserting the following lines in the GridExporting event handler:

    ActivityGrid.Page.Response.ClearHeaders();
    ActivityGrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private);
      
    ActivityGrid.Page.Response.ContentType = "text/csv; name=\"filename.csv\"";
    ActivityGrid.Page.Response.AppendHeader("Content-Disposition", "attachment; filename=\"filename.csv\"");
  16. Ralf
    Ralf avatar
    77 posts
    Member since:
    Jun 2012

    Posted 17 Apr 2013 Link to this post

    Hi,

    we had the same problem in a SharePoint context. The grid is placed in a ASP UpdatePanel and the export button outside for postback.
    The following code solved the problem for us:

    private void _gridViewContent_GridExporting(object sender, GridExportingArgs e)
    {
        if (HttpContext.Current.Request.IsSecureConnection
            && HttpContext.Current.Request.Browser.Type.ToUpper().Contains("IE")
            && HttpContext.Current.Request.Browser.MajorVersion < 9)
        {
            _gridViewContent.Page.Response.ClearHeaders();
            _gridViewContent.Page.Response.Cache.SetCacheability(HttpCacheability.Private);
            _gridViewContent.Page.Response.ContentType = "application/vnd.ms-excel";
            _gridViewContent.Page.Response.AddHeader("Content-Disposition", "attachment;filename=SearchResults.xls");
        }
    }


    Hope this help someone.

    Regards,
    Ralf
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017