Has anyone had experience using Java to decrease the size of an Excel XML file (.xls)? If you programatically use XML to create an Excel file, the file size can grow incredibly large. Would there be any way to use Java to decrease the file size?
If you are finally writing this excel somewhere, how about using the ZipOutputStream?
If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
Joined: Oct 14, 2008
Paul Clapham wrote:Are you asking about the Excel 2007 format? The one whose extension is normally XLSX?
No. I am not referring to the .xlsx 2007 file format. We are generating Excel .xls files via XML using our PeopleSoft system. These files are generated on both Windows and Unix machines. The only downside to the utility is that it can result in a large Excel file (I've had one be 200mb) I'm assuming because it is using XML to create it. Sure when you download the Excel file from the PeopleSoft system and open it in Excel 2007, you can resave it either as .xls or .xlsx and it will dramatically decrease the size. I wanted to avoid having users do this.
Are you saying that the PeopleSoft system is reading an XML document and generating an Excel 2003 XLS formatted document from that? And you think that because the input is XML, that's why the output is large?
Your statement that it is "using" XML is ambiguous. That could mean that the input is XML, or that the output is XML, or that there is some other XML involved in the process.
Joined: Oct 14, 2008
No. The PeopleSoft program is dynamically generating the XML placing it into a file with an extension .xls. Other Excel files are created from what I believe to be comma separated values which is why they are so small. The benefit to using XML is that you can provide formatting options and such that I don't believe you can provide with comma separated. So for example, our PeopleSoft application is dynamically generating the XML below. I have a feeling there isn't going to be anything that I can do to decrease the size. Either I use comma separate values and forgo my ability to format the look of the data or I use XML which could result is a somewhat large Excel file.
Right, so it IS using the Excel 2007 format, even though it just gives the filename an extension of XLS.
You're right, if you want formatting of any kind, or formulas, or other things which can't be done in plain CSV files, you're stuck using an Excel format. It's true that the new (2007) format is more bulky than the old (2003) format, but the new format is the Way Of The Future™ and resistance is ultimately futile.