开发者

Getting extension check(hardening) alert while opening a .xls file using Office 2007/2010

开发者 https://www.devze.com 2023-02-27 11:43 出处:网络
I am working on a struts based web application. In that application, we generate and download xls file from Jsp.

I am working on a struts based web application. In that application, we generate and download xls file from Jsp. In Jsp file and web.xml, I have set the content-type as "application/vnd.ms-excel"

it see开发者_如何学Cms xls files generated by the jsp pages are not real excel files, but a text format that is understood by the MS Excel. Hence excel opens the files and displays the output similar to excel files saved by MS Excel. Since newer versions of MS Office 2007/2010 checks the file extension and the content inside the file, they issue a warning that the file format does not match with the content.

To get rid of the warning how can i ensure that the generated xls is real office excel file .

Please help.


For future readers who might need this... Excel will complain anyway, even if your excel file is 'correct', as long as its structure doesn't properly match the extension. So if you're saving as an .XLS, it expects to see the classic excel file. The popup you are getting is because of the new security feature in Office 2007, called Extension Hardening and you can disable it if you want - either manually in the registry, or you can save the patch to a .REG file and share it to you clients etc.

Save those 2 line below into a GiveItSomeName.reg file, which you can then email to your clients and tell them to execute it.

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security]
"ExtensionHardening"=dword:00000000
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号