diff --git a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/BaseStreamResourceWriter.java b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/BaseStreamResourceWriter.java index c0db5a9..d1e291a 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/BaseStreamResourceWriter.java +++ b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/BaseStreamResourceWriter.java @@ -49,7 +49,7 @@ abstract class BaseStreamResourceWriter implements StreamResourceWriter { private static final Logger LOGGER = LoggerFactory.getLogger(BaseStreamResourceWriter.class); protected GridExporter exporter; - protected String template; + private String template; public BaseStreamResourceWriter(GridExporter exporter) { super(); @@ -63,6 +63,10 @@ public BaseStreamResourceWriter( template = customTemplate == null ? defaultTemplate : customTemplate; } + protected String getTemplate() { + return template; + } + /** * If a column was configured to be exported or not, that will be honored. If not, it will * exported based on the visibility diff --git a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/DocxStreamResourceWriter.java b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/DocxStreamResourceWriter.java index 23be0bb..5654dbb 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/DocxStreamResourceWriter.java +++ b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/DocxStreamResourceWriter.java @@ -361,7 +361,7 @@ private XWPFTable findTable(XWPFDocument doc) { } private XWPFDocument getBaseTemplateDoc() throws EncryptedDocumentException, IOException { - InputStream inp = this.getClass().getResourceAsStream(template); + InputStream inp = this.getClass().getResourceAsStream(getTemplate()); return new XWPFDocument(inp); } } diff --git a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelStreamResourceWriter.java b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelStreamResourceWriter.java index c84314e..7a3587a 100644 --- a/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelStreamResourceWriter.java +++ b/src/main/java/com/flowingcode/vaadin/addons/gridexporter/ExcelStreamResourceWriter.java @@ -391,7 +391,7 @@ private void applyExcelFormat(Cell cell, String excelFormat, Map