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

Html based export format is not working in Excel 2010

8 Answers 294 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 19 Jul 2016, 01:32 PM
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

8 Answers, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 26 Aug 2016, 09:01 PM
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()



0
Nilay Shah
Top achievements
Rank 1
answered on 30 Aug 2016, 12:34 AM

Hi,

Is there any workaround for Excel 2007?

0
Doug
Top achievements
Rank 1
answered on 30 Aug 2016, 12:20 PM
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.
0
Andrew
Top achievements
Rank 1
answered on 31 Aug 2016, 12:00 PM

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

0
Eyup
Telerik team
answered on 31 Aug 2016, 12:03 PM
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.
0
Doug
Top achievements
Rank 1
answered on 31 Aug 2016, 12:31 PM
Andrew, do you have some sample code on how to remove buttons during itemdatabound before exporting?
0
Eyup
Telerik team
answered on 05 Sep 2016, 08:14 AM
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.
0
Andrew
Top achievements
Rank 1
answered on 06 Sep 2016, 03:43 PM
        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
Tags
Grid
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Answers by
Doug
Top achievements
Rank 1
Nilay Shah
Top achievements
Rank 1
Andrew
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or