I cannot manage with this problem. The source is:
try {
// 1) Load Docx file by filling Velocity template engine and cache it to the registry
InputStream in = new FileInputStream("/test.docx");
IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in,TemplateEngineKind.Velocity);
// 2) Create context Java model
IContext context = report.createContext();
context.put("user", variables.get("user"));
// 3) Generate report by merging Java model with the Docx
OutputStream out = new FileOutputStream(new File("/test_Out.docx"));
report.process(context, out);
} catch (IOException e) {
e.printStackTrace();
} catch (XDocReportException e) {
e.printStackTrace();
}
When I'm trying to proceed this code I've got error:
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) fr.opensagres.xdocreport.core.XDocReportException: Impossible to create report for the input stream. The report loader supports only [] files type.
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.createReport(XDocReportRegistry.java:328)
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.createReport(XDocReportRegistry.java:313)
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:285)
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:278)
09:03:15,608 ERROR [stderr] (http--127.0.0.1-8080-1) at fr.opensagres.xdocreport.document.registry.XDocReportRegistry.loadReport(XDocReportRegistry.java:264)
And it points to the line:
IXDocReport report = XDocReportRegistry.getRegistry().loadReport(in,TemplateEngineKind.Velocity);
What does it mean - The report loader supports only [] files type.? It there anything wrong with loading data from the InputStream? I've no idea how to solve this. Please help!