Java .doc generation
        Posted  
        
            by bozo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by bozo
        
        
        
        Published on 2010-04-08T07:11:47Z
        Indexed on 
            2010/04/08
            7:13 UTC
        
        
        Read the original article
        Hit count: 501
        
Hi,
anyone knows an easy method to generate mail merge .doc file from Java?
So, I want to create a Word (95/97) document in Word, put some simple placeholders in it (only single value, no iterators and other advanced tags) like the ones used with mailmerge option, and then at runtime replace those placeholders with values from Java.
One option is to use Jasperreports, but this would require that I create exact replica of non-trivial Word document in Jasper format, which is not easy and is hard to change later.
Is there some method of filling placeholders in Word from Java, which does not require low-level document alteration with positioning and others low-level .doc tags from code, but something like this:
docPreparer.fillPlaceholder('placeholder1', 'my real value from runtime');
Some CRMs do this via ActiveX control for internet explorer, and it works great (they use Word's mailmerge) but I need an all-Java solution.
Ideas?
Thanks,
Bozo
© Stack Overflow or respective owner