Html based export format is not working in Excel 2010

9 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 19 Jul Link to this post

    After a security update for Microsoft Excel 2010 (KB3115322) which was released on 12 July 2016 documents using HTML based Excel format could not be opened. There is already an open discussion in Microsoft Community forums and we hope the issue will be resolved soon. Meanwhile the possible solutions are to either uninstall the update or uncheck Enable Protected View for files originating from the Internet option from Options -> Trust Center -> Trust Center Settings -> Protected View in Excel. Another option is to use some of the other Excel formats where this issue could not be observed.

    Update (August 2016)

    You can find below the official announcement by the Microsoft Excel Support Team about this matter and its Resolution:
    Excel Workbooks may not open after installing MS16-088

    Here is another reference:
    KB3170008 for Office 2016 Breaks Functionality - MS16-088

  2. Doug
    Doug avatar
    68 posts
    Member since:
    Aug 2014

    Posted 26 Aug in reply to Telerik Admin Link to this post

    the new patch Microsoft put out fixes this issue as they reported here
    https://support.office.com/en-us/article/Fixes-or-workarounds-for-recent-issues-in-Excel-for-Windows-49d932ce-0240-49cf-94df-1587d9d97093?ui=en-US&rs=en-US&ad=US

    open up HTML files with .XLS not opening outside protected view in Excel > for the KB updates that fix this issue

    the new issue (I think) I have is my grid has hidden inputs that get exported out to excel which excel thinks the file is corrupted.
    if I save the file, open with notepad and remove all hidden inputs, then the file will open.

    I am unsure if Telerik export removes inputs from the export or not or if it just doesn't remove all types of inputs?

    code is using the gridview1.ExportToExcel()



  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nilay Shah
    Nilay Shah avatar
    4 posts
    Member since:
    Jul 2009

    Posted 29 Aug Link to this post

    Hi,

    Is there any workaround for Excel 2007?

  5. Doug
    Doug avatar
    68 posts
    Member since:
    Aug 2014

    Posted 30 Aug in reply to Nilay Shah Link to this post

    not sure about your version 2007 but I know earlier version do not even have this issue because the original update (posted in July 2016) to office did not update earlier versions of office. I am unsure of the cutoff point. so the earlier versions do not have this issue at all.
  6. Andrew
    Andrew avatar
    2 posts
    Member since:
    Jan 2008

    Posted 31 Aug Link to this post

    I found that excel files (HTML variety) with buttons where being blocked if the buttons are removed then it opens fine.  Grouping adds buttons to an export.

     

    I used the "ItemDataBound" method to remove buttons when I found them when an export was being processed

  7. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 31 Aug Link to this post

    Hello Doug,

    Thanks for sharing your opinion and links with our community. I hope they help other developers as well.

    As for your specific question, it is better to open a formal support thread for technical related queries. Thus, our team responsible for the RadGrid component will handle the case accordingly.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  8. Doug
    Doug avatar
    68 posts
    Member since:
    Aug 2014

    Posted 31 Aug in reply to Andrew Link to this post

    Andrew, do you have some sample code on how to remove buttons during itemdatabound before exporting?
  9. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 05 Sep Link to this post

    Hi Doug,

    RadGrid now provides the IsExporting property, which can be used in ItemDataBound and ItemCreated scenarios. Please check the following section for further info:
    http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/functionality/exporting/export-formats/word-and-excel-export/html-based-export#using-itemcreateditemdatabound

    Also, please bear in mind that the ItemDataBound will be raised on Exporting action only if the IgnorePaging property is enabled.

    Regards,
    Eyup
    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  10. Andrew
    Andrew avatar
    2 posts
    Member since:
    Jan 2008

    Posted 06 Sep in reply to Doug Link to this post

            ElseIf (TypeOf (e.Item) Is GridGroupHeaderItem) Then
                Select Case ItemCommandButtonID
                    Case "mngBtnPDF", "mngBtnPDFp", "mngBtnPDFl", "mngBtnExcel", "mngBtnExcelStyled", "mngBtnCSV", "mngBtnExcelBiff", "mngBtnExcelXLSX"
                        Dim dataBoundItem As GridGroupHeaderItem = CType(e.Item, GridGroupHeaderItem)

                        For Each Cell As TableCell In dataBoundItem.Cells
                            If Cell.HasControls Then
                                If Cell.Controls(0).GetType().ToString() = "System.Web.UI.WebControls.Button" Then
                                    'Do Nothing Buttons Should Not Be Going Out
                                    Cell.Controls.RemoveAt(0)
                                End If
                            End If
                        Next
                End Select
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017