开发者

Java :- How to save in Microsoft Excel 2010 when read through csv

开发者 https://www.devze.com 2023-03-27 16:51 出处:网络
I am able to read the csv file in Microsoft excel, but when I try to save it, it gets saved as text as it\'s in tab delimited form and the changes made are lost.

I am able to read the csv file in Microsoft excel, but when I try to save it, it gets saved as text as it's in tab delimited form and the changes made are lost.

WebUtils.download(response, datafetcher, form.getString("rep开发者_运维问答ortName") + ".xls",
                "application/vnd.excel", hdr, "\t");


If I'm reading this right, you are relying on the fact that Excel will go ahead and load a CSV file that is called something.XLS, but when it's saved again it will maintain the CSV format and therefore lose all the formatting applied. As DwB says, Excel should warn about this with a fairly clear message unless that's been disabled.

I don't think there's a lot you can do here, other than some client education or rewriting your report to actually export a genuine XLS or XLSX file.

0

精彩评论

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