Alberto
unread,Jun 8, 2009, 9:13:04 AM6/8/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to jOpenDocument
Hi all,
I'm not able to fill a document properly, following the example, using
Java5:
Field Filling works fine
Paragraph showing or hiding does not work, that is, paragraph 'p1' is
never displayed.
No compile nor runtime errors.
I am using jOpenDocument-1.1-jdk5.jar, JDK 1.5.0_15, OO 2.4.1, Linux
Fedora 9.
I can't understand...
something wrong in my template? I'll post it if needed.
Can someone help me?
Ciao
Alberto
public static void main(String[] args) {
// TODO Auto-generated method stub
File templateFile = new File("/home/adt/test1.odt");
File outFile = new File("/home/adt/out1.odt");
// Load the template.
// Java 5 users will have to use RhinoFileTemplate instead
try {
RhinoFileTemplate template = new RhinoFileTemplate(templateFile);
// Fill with sample values.
template.setField("n1", "Field one");
template.showParagraph("p1");
// filed n1 is before p1 paragraph, and it is
showed correctly
// Save to file.
template.saveAs(outFile);
// Open the document with OpenOffice.org !
OOUtils.open(outFile);
}
catch (Exception e) {
e.printStackTrace();
}
}