• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
HousewarRs.1275.00
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)

reply
    Bookmark Topic Watch Topic
  • New Topic