I'm using POI 3.9 to read Excel files in my Java application. I'm exporting some tables from MySQL query browser for filling it with data to match the table columns.
When I open this file a dialog pops up giving the warning: 'The file xyz.xls is in a different format....' but does open on clicking OK. At the same time this file is also refused by the Java application giving the following reason:
Also note that I am using the factory method which handles the loading of desired file (.xls and .xlsx) if my understanding is right. This is how I pass the File as an InputStream.
But the file is accepted by POI once I save it as a .xlsx file. So my question is,
1) How do I prevent Query Browser corrupting the file (if it is) ?
2) The sheet will be loaded by the end user and the person will be inconvenienced always saving it to .xlsx. How do I avoid this assuming it is not a user-friendly way?
I am a man of mystery. Mostly because of this tiny ad: