Discussion Locked

Create Excel-formatted data

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Do you think the Jakarta POI project and the HSSF component will make creating Excel-formatted data easier for Java applications?

11 replies

by henry.hereford

I cannot imagine that Microsoft will long tolerate it.Just as AOL took steps to exclude MSFT's Messenger by successive modifications to IM, I can easily imagine Microsoft coming out with some sort indispensable patch or SP for Office, under pretext of a newly discovered security hazard, which will render all of Jakarta's hard work useless.

Regards,

Robert Schainbaum

by bayard-generationjava

You're a cynic, just liked me. So rather than answer this myself, I asked the head of the POI project for an answer [Andrew Oliver].
===========================================

The fact of the matter is the last time a serious change happened was 1997. However while we choose not to support Excel 95 files for practical reasons (supporting a derivative of the low level binary record is just a bit more of a pain than having just one version, and very few people use Office 95 anyhow), it would be maybe a weeks worth of work to do so. The last REALLY REALLY major change was 95 when the file format was wrapped in OLE 2 Compound Document format.

All in all I've not seen any serious signs of this happening.
OpenOffice has been able to read and write excel files reasonably well for some time now and microsoft has shown no real inclination to radically change the file format. There is a good reason for this...they'd be fighting their own install base.

HSSF, the Excel componentof POI, seeks to be compatible with the largest segment of the population. If they radically changed the format it would probably be similar to the difference between 95 and 97 rather than 4.xx->95. In which case I'd have a whole week's work figuring out what the differences were (and thats if I didn't have any help). While I appreciate your sympathy and concern for this possibility it doesn't keep me up at night.

by bucky kaufman (mcsd)

Since Excel can read and write to HTML, and so can Java, it's better to use HTML (or XML) as the intermediary format. Using Java to create Excel files, or Excel to write java files, is inefficient.

As you can tell by the name of the function, this is more about expressing resentment than about interop, and it's better suited toward expressing resentment than for enabling interoperability.

by bayard-generationjava

Thanks for the comment Bucky. I've not used HTML in Excel much so I went to the horses mouth with your comment and asked one of the POI leads [Andrew Oliver] if he had a reply. Here it goes:
================================================

Have you ACTUALLY tried to do that in a serious application? Especially
with large files? Its a royal pain! A large percentage of the time
Excel crashes. I've done this...trust me...it isn't pretty for
non-trivial applications. Also XLS format is much more compact than
HTML/XML.

As for the name. Well there is a long story behind that. Marc Johnson
the cofounder of POI didn't want to name it... I didn't either. But I
gave in and it was the least stupid thing I could think of that was
descriptive of the file format. Secondly, a derogatory name was
necessary to politically navigate OpenSource politics. We wanted to
avoid criticism that we were propagating the already ubiquitous file
formats rather than opening them up. In truth I don't have a great deal
of contempt for Microsoft. I've more contempt for Actuate who bought
"tidestone" who produced "Formula 1" (which is similar to HSSF...but
HSSF can run on a mainframe...formula 1 can't..due to ties to AWT), they
promptly raised the price to like 10-15k per processor. Microsoft is
cool because they make such great brain teasers! I even like Microsoft
Office... I just can't stand their operating systems!

by hifi78

The beauty of using POI is that when a user calls and asks for a spreadsheet with such and such data on it, you never even have to think about HTML, XML, parsers, or any of the hundreds of other details that go into effectively desiging a the spreadsheet. Instead, you focus on using the POI methods to implement your business logic and sending the output to a file.

Of course, in a perfect world, everything would be perfectly XML compliant, and POI would be replaced by a simple XML schema. But when a user wants an Excel file sent to them and your deadline is yesterday, tools like POI are just what the doctor ordered.

by henry.hereford

I have no way of knowing that Jakarta didn't use XML or HTML to accomplish their Java to Excel mapping. That's just hidden implementation detail and of no interest to the user of a library. The beauty is in the simplicity of having an interface thatallows for treating a worksheet as very nearly the equivalent of a subscriptable array.

by bayard-generationjava

Hey Robert,

Andrew Oliver had also sent a reply to this post when I discussed the other questions. Thought you might be interested in his reply here:
================================================

No we don't use such a mapping. There is however an HSSF Serializer for
Cocoon (http://xml.apache.org/cocoon) which lets you serialize XML->XLS.

The initial idea behind POI was to give me something fun to do that was
actually hard. (web programming isn't actually hard). Digesting and
figuring out Microsofts low level binary file formats and mapping them
to Java which hasn't the best IO support...that's hard.

by ian ( chicago )

I have a new project that needs to create MS Excel files. I know I can use VBA to master this exercise but, I would like to use Java, write once run anywhere. How do I obtain the Classes (POI)?

by khanhqhoang

Hi,

You were talking about create a single sheet excel file.
How is about
- create multi sheets excel file
- page content for multi sheets
- outline format
- table header format etc...

I have requirement to do all of those but does not know how to do it in java. From visual basic stand point, we have
to create a macro that is called by a bat file to transform
the csv file to the excel file with the features we want.

Any suggestion and guidance are truly appreciated.

by bayard-generationjava

It handles multiple sheets and can handle formatting issues, such as font colour etc. Whether it can do all the advanced bits you want, I don't know and would have to point you off to the POI community.

Sorry about that,

Hen

This discussion is closed to new replies.