This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Write JTable to Excel file

Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello. I need to export a JTable to an excel file, but there is some formatting required. First of all, independent from the table, I need to write in a corner some data abou a company. Then , right before the table, I need to write a title, on the middle of the page. These information need to be written with a font different than the one used to write in the table: bold, a bit bigger and underlined. Then there comes the table. The table needs to appear with a table structure, meaning to have the borders that show that it is a table. Everything that I mentioned above needs to look like that when I set the excel file for printing. I don't know if what I want is very clear, i'll explain it again if necesary, but does anybody know if this can be done, and if so, what would be the best tool for it?

I found the jxl jar and an example on it, but it just exports the data as it is, and when i try to print the page, it doesn't show a table, just info written one under another, the info is not formatted, meaning i looks something like this:

DepartmeDaily Revenue
Pets Rs.125.00
Electronic Rs.2533.00
Menswear Rs.497.00

instead of looking like this:

Department Daily Revenue
Housewares Rs.1275.00
Pets Rs.125.00
Electronics Rs.2533.00
Menswear Rs.497.00

and having the table border, and column names specified explicitly (with different font)

You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic