• 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

to print a table in word(.doc file)

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

How do we create a word document containing a table with values using Java. The heading of the table has to be bold.
Please help!

Thanks
Praveen
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you tried? Where did you fail? ShowSomeEffort.
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read some thing regarding Apache POI API. It may help you.
 
praveen shinde
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am able to read the values in cell from excel document. But unable to draw the table in the word document.
this is my for reading excel file


download the java library from
http://sourceforge.net/projects/jexcelapi/

Thanks
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Word and Excel, although both part of MS Office, are very different in structure. The reason you're able to put Excel tables in Word is because of OLE objects. The Word document contains a little part that is actually asking Excel to do the hard work.
 
praveen shinde
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to create a table in word document which contains the values extracted from the database using java?
Thanks
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

praveen shinde wrote:Is it possible to create a table in word document which contains the values extracted from the database using java?


Yes. You've already been pointed to the Apache POI library that can create DOC and DOCX files. But if I wanted to create complex text documents, I'd probably create an RTF template by hand, add some easily recognizable placeholders (like "<<table>>"), and then use text search/replace to fill in the actual content using RTF markup. Most text processors (and Word in particular) can read RTF just fine.
 
praveen shinde
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
After hours of googleing on net I found a javadocx which could just draw a table without adding any contents to the table. But i have to add content from database which is not supported in free version. so if anyone knows any silmilar tool please let me know.
I could not find any code on Apache POI.
Any help would highly be appreciated
Thanks
Praveen
 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you tried? Where did you fail? ShowSomeEffort
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic