X

Geertjan's Blog

  • June 24, 2006

OpenOffice.org API and Spreadsheet Generation

Geertjan Wielenga
Product Manager
Using very similar principles to those outlined in recent OpenOffice.org API related blog entries, I now also have a spreadsheet generation functionality added to a very simple Swing application. Here's the Swing application:

When you click the Generate Report button, assuming you have both radiobuttons selected (i.e., you can select either, both, or neither and depending on the choice, the most/least replied-to article is highlighted in a distinctive color), the OpenOffice.org Calc spreadsheet shown below opens, displaying all the results (every other line a different color, good thing for readability), together with the total replies per article as well as a color-coded indication of which article has most/least replies and, below the spreadsheet, the author of the most/least replied articles with the related background color:

I'm planning to write an article describing how all this is put together (it is surprisingly simple, if you use some standard methods from the OpenOffice.org API) for Javalobby. So... I won't reveal any of the secrets behind this application yet, otherwise you'll have no reason to read the article...

NB: Of course, the user interface is very simple. Normally you wouldn't want your users to select an executable in the main window of your application. And all the data is hardcoded; it doesn't come from a database. However, that's kind of the point. The user interface shown here was put together in about 10 minutes (most of those minutes went into hardcoding the table's values) in order to provide a simple user interface for testing out my code. That's one of the wonderful things about using the NetBeans GUI Builder (a.k.a. Matisse): you can very quickly pull something together for prototype/testing purposes.

Join the discussion

Comments ( 2 )
  • Azri Sunday, June 25, 2006
    Looking forward for it.
  • guest Sunday, June 25, 2006
    Come on, post it already! :)
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.