views:

429

answers:

4

Can I edit an excel file from a browser using POI? Something like google docs maybe? But in java? I've used POI for display only, way way back, but I dont remember it being editable from the browser. Any suggestions of the best approach to this? The excel will display a list/table with data, and each row will either be reported as having 'good' or 'bad' data, and the user can then go to a bad row to correct it and edit this and submit this..

+1  A: 

Can I edit an excel file from a browser using POI? No, you can try like google does with their AJAX apps for excel. But I think such an implementation isn't affordable.

You can use java dialogs and let poi create and process excel sheets. But you should suggest a few things if you want to do so:

From my experience:

  • POI (Poor Obfuscation Implementation) is a bad and unstable framework. If you want to develop business solid software you have to deal with proprietary software for propreitary data formats like .doc/.xsl/.docx ...

  • Think about licencing issues! You have to ensure that every user has a Office licence if you work with automized word versions on the server side (except Open Office UNO..)

The best way? Don't use POI.

Martin K.
Thanks! does google provide api's for g docs like requirements/functionality? I think i'd still probably use POI just for displaying. User will have to just save excel file locally and re-upload. any better ideas though?
javacruiser
With POI you can read and write excel files. Mostly the office files become corrupted (my experience). For any business critical app, it's mostly the best to call a .net webservice. C#.net handles excel files very well. I don't know how the google api's can deal with native formats. Maybe it's the best way to work with them?
Martin K.
+1  A: 

There's no reason why you couldn't load data from an MS Office doc in the browser, then push changes back to the file stored on the server (wouldn't be surprised if GDocs works this way). This can be done with a few servlets.

Your real challenge is going to be writing code to display documents in a useful form.

Dana the Sane
+1  A: 

POI works fine for manipulating Excel data. I've found it's appropriate for most Excel-based use cases and not had any issues with it. It's quite explicit in what it claims to support and what it doesn't.

The difficulty you face is in the presentation/display. As you're in looking at Java-based solutions, take a look at using GWT for a browser-based rich interface. You'll be looking at some sort of grid-based interface in the browser (perhaps the simple GWT Grid), and the combination of GWT/POI should work well.

See the Advanced GWT demo for an example of an editable grid.

Brian Agnew
A: 

Maybe you can use java spreadsheet applet. try this one:

Jxcell spreadsheet component

liya