views:

176

answers:

3

A question that seems to have quite a few options for Python, but none for Java after googling for two days. Really really could use some help all I have found so far is a recommendation to use gaeVFS to build an excel file from the xml components and then zip it all together which sounds like a slap in the face. Oh yes and if you were wondering I am questioning my use of Java rather than python but at 5,000 lines of code it would be insane to turn back now...

Other things you might find useful

  • Client: GWT
  • Server: Servlets running on google app engine storing data into the google data store
  • Excel file: mandatory, CSV isn't good enough, no need to save the file just to be able to "serve" it to the client i.e. open a "Save As" box.
+2  A: 

Have you checked out this api already: Java Excel API ?

Winston Chen
Looking at its use of the File class I also think it won't work on app-engine. Again would be happy to be wrong on this one.
Joseph
Use Workbook.getWorkbook(java.io.InputStream is) to construct a workbook. Here comes the process:Firstly, you can convert a string into a reader through a StringReader: http://java.sun.com/j2se/1.4.2/docs/api/java/io/StringReader.html. Then convert the reader into an inputstream: http://www.koders.com/java/fid0A51E45C950B2B8BD9365C19F2626DE35EC09090.aspxFinally, use the getWorkbook() method aforementioned to construct your workbook.
Winston Chen
or, there is another way to construct an inputstream:StringBuffer StringBuffer1 = new StringBuffer("Java Forums rock");ByteArrayInputStream Bis1 = new ByteArrayInputStream(StringBuffer1.toString().getBytes("UTF-8"));This works fine too.
Winston Chen
A: 

You could also take a look at the Apache POI project. You can read and write MS Excel documents with this library.

Binary Nerd
cool.. I didn't know this one though.
Winston Chen
my understanding is that the libary doesn't work on google app engine. If wrong I would be a very very happy man...
Joseph
A: 

Take a look at this post. It's a step by step tutorial on how to generate excel files on google app engine.

cYrAX