Search code examples
exceldisplaytagstruts-1

What is the difference between .xls file exported with Display tag and created with Excel


I use Display tag in Struts 1.3 to export a table to .xls file.I can export this without any problem and I can open this file with a text editor and view or edit.

<display:setProperty name="export.excel.filename" value="Export.xls"/>


Then created .xls file in Excel 2003 and try to edit it with text editor, but it's binary file. The file size created with Excel is much bigger comparing to exported file.
Furthermore, When I try to open the exported .xls file in Excel 2013 it gives following popup,

"The file format and extension of 'Export.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source ,don't open it. Do you want to open it anyway ? (Yes/No/Help)"

What is the reason for this?


Solution

  • I found the reason behind this.
    The exported Excel(.xls) from displaytag is text-based excel and not a POI-based excel.But Excel application creates binary .xls file.