Skip to content

Instantly share code, notes, and snippets.

View matthiaszimmermann's full-sized avatar

Matthias Zimmermann matthiaszimmermann

  • etherisc.com
  • Zurich
View GitHub Profile
@matthiaszimmermann
matthiaszimmermann / gist:5922844
Created July 3, 2013 21:08
fill content into a Word template file using the Docx4j support for Eclipse Scout
private File runReport(File template) throws ProcessingException {
// copy original template file into temp file
File tmpFile = IOUtility.createTempFile(IOUtility.getTempFileName(".docx"), IOUtility.getContent(template.getPath()));
DocxAdapter docxFile = new DocxAdapter(tmpFile);
Map<String, String> variables = new HashMap<String, String>();
// populate doc variables
variables.put("Name", "John Doe");
variables.put("Phone", "(123) 456 78 90");
variables.put("CompanyName", "BSI Business Systems Integration AG");