• 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

How to read value and out put in Word document? Please, help me.

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
My requirement is as below:
We save template values in the html tag like <table><tr><td>Name</td></tr></table>
in MsSQL database.
Now, I need to write a java code that can read each record as mentioned above and the ultimate
out put must be in individual word document for individual record.

Another challenging task, code should be capable to read more than six lakh records
form the database table at a stretch
.

Any idea, how to proceed? Please, help me.

Regards
Gautam
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So you need to extract data from HTML and write it to a Word document; is that correct? If so, you could use a library like NekoHTML or TagSoup to access the data in the HTML file, and then use the POI library to create a Word file. Here's an example of how to do the latter: http://faq.javaranch.com/java/CreateWordDocument

If the HTML data isn't a full document, but really just a snippet like the one you posted above, then a regular expression, or a series of string operations, should be sufficient to retrieve the data.
 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please, help me. I am stuck
 
Bartender
Posts: 1849
15
Eclipse IDE Spring VI Editor Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you read the FAQ that Ulf posted earlier? Did you try the code out to see how it works? What do you have so far?
 
Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ulf
thanks for your reply.
My requirement is slightly different. Let me clarify again.
I need to extract data from HTML into word document as well as the
look and feel of the word document must be same as with the HTML contents
in the browser.
Another challenging part, code must be compatible enough to read more than
six lakh record from database at a stretch.

Regards
Gautam



 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's full documents that you're converting, then the JODConverter library may be for you. It requires OpenOffice to be installed, but it sounds as if this is to be done on a server, so that shouldn't be a problem.

I don't understand how "compatibility" (of what?) should have an impact on performance; maybe you can elaborate.
 
I was born with webbed fish toes. This tiny ad is my only friend:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic