File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reduce Excel XML file size

 
Chuck Mondi
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for us beginners. Moving.
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you asking about the Excel 2007 format? The one whose extension is normally XLSX?
 
Jhakda Velu
Ranch Hand
Posts: 167
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If you are finally writing this excel somewhere, how about using the ZipOutputStream?
Jhakda
 
Chuck Mondi
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic