aspose file tools*
The moose likes General Computing and the fly likes Reduce Excel XML file size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Reduce Excel XML file size" Watch "Reduce Excel XML file size" New topic
Author

Reduce Excel XML file size

Chuck Mondi
Ranch Hand

Joined: Oct 14, 2008
Posts: 31
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?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38818
    
  23
Too difficult a question for us beginners. Moving.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Are you asking about the Excel 2007 format? The one whose extension is normally XLSX?
Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 166
Hi
If you are finally writing this excel somewhere, how about using the ZipOutputStream?
Jhakda


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.
Chuck Mondi
Ranch Hand

Joined: Oct 14, 2008
Posts: 31
Paul Clapham wrote:Are you asking about the Excel 2007 format? The one whose extension is normally XLSX?

Paul,
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.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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.
Chuck Mondi
Ranch Hand

Joined: Oct 14, 2008
Posts: 31
Paul,
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.

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reduce Excel XML file size