jasper reports - Convert ODT to doc/rtf format in java -


i have application kicks out various documents in various formats. it's main purpose. using japser of non excel documents , realise may have made mistake! (i can't afford aspose !). operating in windows environment.

essentially many of documents produced in both odt , doc format. requirement word version doc compatible maximum number of users (who outside organisation).

for exporting in rtf format doc suffixed file. far except tables exported text input boxes not tables , users upset can't tab between cells (we missed in testing). seems cannot sorted out in report configuration. rtf export not export tables tables.

i considered saving docx , using poi convert doc doesn't seem simple

  • lack of interface between xwpf , hwpf.
  • there seems bug in jasper export docx sets margins 0 , causes printing warnings. surmountable quick & dirty fix idea beginning seem more effort such messy solution worth.

this leaves me idea of converting odt files doc. i've had quick @ jodconverter seems long since has done i'm not convinced way go (i'm not sure compatible openoffice 4.1 i've downloaded although guess out of that?).

so main part of question - there reasonably simple way convert odt doc/rtf in java code (i don't want overhead of sending documents external conversion sites). guess aside serious jasper guru's - there way of exporting rtf/doc format tables table objects rather collections of adjacent text input boxes ?

i've tried lay out in full, apologies if it's little verbose. appreciated (the simpler solution better!).

you can try jodconverter conversion between odt , doc(x) there's litte documentation library , it's no longer maintained.

according little doc there (here , here), here's little example convert odt doc file (you need have openoffice or libreoffice installed locally)

officemanager officemanager = new defaultofficemanagerconfiguration().setofficehome(new file("<path office home>")).buildofficemanager(); officemanager.start();  officedocumentconverter converter = new officedocumentconverter(officemanager); converter.convert(new file("test.odt"), new file("test.doc"));  officemanager.stop(); 

<path office home> must replaced path home directory of libreoffice or openoffice (the directory contains soffice.bin file).


Comments