Skip to main content
Jump to: navigation, search

Scout/HowTo/3.9/Creating Word Reports with Docx4j

< Scout‎ | HowTo‎ | 3.9
Revision as of 14:27, 3 July 2013 by (Talk | contribs) (Activate the Docx4j Support for a Scout Application)

This how-to describes how to:

  • Load a Microsoft Word (docx) template file
  • Load content into it's docvariables
  • How to pouplate tables
  • How to export the resulting Word document (report)

This how-to makes use of the Docx4j support provided on the Eclipse marketplace.

Activate the Docx4j Support for a Scout Application

The simplest way to integrate the Docx4j support in a Scout application is to tick the checkbox Docx4j Support in the Scout Object Properties of the Scout application as shown in the screenshot below.

Download docx4j.png

The SDK will then download the docx4j component and update the Scout project setup accordingly. Leave all default settings and accept the suggested proposals.

Create Word Reports

   public class RunReportButton extends AbstractButton {
     protected String getConfiguredLabel() {
       return TEXTS.get("RunReport");
     protected void execClickAction() throws ProcessingException {
       File template = new File(getTemplateField().getValue());
       File report = runReport(template);

Back to the top