1
I have an application that reads a file xml
, takes the data and passes to a file in the format xls
. But when I open the file that was Erardo appears the following message:
Would someone explain to me the cause of this mistake?
1
I have an application that reads a file xml
, takes the data and passes to a file in the format xls
. But when I open the file that was Erardo appears the following message:
Would someone explain to me the cause of this mistake?
5
The POI is divided into libraries H and X.
Libraries H (HSSF, HWPF, HSLF) produce documents in format .doc, .xls and .ppt, as libraries X (XSSF, XWPF, XSLF) produce the formats .docx, .xlsx and .pptx.
Since Voce is using XSSF, change the file extension saved to .xlsx solves the problem.
If I want xls I have to search the H libraries?
Correct. The two libraries are very similar, but X (newer) has more features. Do you really need to produce . xls? The format. xlsx is already 8 years old.
Yes, because some clients still use old versions of office :/
Browser other questions tagged java excel apache-poi
You are not signed in. Login or sign up in order to post.
Can you post the code? Without it it is difficult to help
– adelmo00
The code is a little "Giant". But I think I managed to solve, I saw something about changing to xlsx format. I will do some more tests
– DiegoAugusto
If it’s too big, I recommend putting it in the bin and pass the link. If you get the solution be sure to put the answer. =)
– adelmo00
I’ll put it in the Stebin.
– DiegoAugusto
Reporting class: http://pastebin.com/NDmQ4LHs
– DiegoAugusto
Method: http://pastebin.com/HwzPamj4
– DiegoAugusto
I looked here at the documentation that the Xssfworkbook class generates file. xlsx and Hssfworkbook generates .xls. file Changes the ai extension in your code to see if it works.
– adelmo00