Project project = new Project("XDocReport"); context.put("project", project);
public static void main( String[] args ) { try { // 1) Load Docx file by filling Velocity template engine and cache // it to the registry InputStream in = DocxProjectWithVelocity.class.getResourceAsStream( "DocxProjectWithVelocity.docx" ); IXDocReport report = XDocReportRegistry.getRegistry().loadReport( in, TemplateEngineKind.Velocity ); // 2) Create context Java model IContext context = report.createContext(); Project project = new Project( "XDocReport" ); context.put( "project", project ); // 3) Generate report by merging Java model with the Docx OutputStream out = new FileOutputStream( new File( "DocxProjectWithVelocity_Out.docx" ) ); report.process( context, out ); } catch ( IOException e ) { e.printStackTrace(); } catch ( XDocReportException e ) { e.printStackTrace(); } } }
Project project = new Project( "XDocReport" ); context.put( "project", project );
public static void main(String[] args) { try { // 1) Load Docx file by filling Velocity template engine and cache // it to the registry InputStream in = DocxProjectWithVelocity2XHTML.class .getResourceAsStream("DocxProjectWithVelocity.docx"); IXDocReport report = XDocReportRegistry.getRegistry().loadReport( in, TemplateEngineKind.Velocity); // 2) Create context Java model IContext context = report.createContext(); Project project = new Project("XDocReport"); context.put("project", project); // 3) Generate report by merging Java model with the Docx OutputStream out = new FileOutputStream(new File( "DocxProjectWithVelocity_Out.html")); // report.process(context, out); Options options = Options.getTo(ConverterTypeTo.XHTML).via( ConverterTypeVia.XWPF); report.convert(context, options, out); } catch (IOException e) { e.printStackTrace(); } catch (XDocReportException e) { e.printStackTrace(); } } }
public static void main(String[] args) { try { // 1) Load Docx file by filling Velocity template engine and cache // it to the registry InputStream in = DocxProjectWithVelocity2PDF.class .getResourceAsStream("DocxProjectWithVelocity.docx"); IXDocReport report = XDocReportRegistry.getRegistry().loadReport( in, TemplateEngineKind.Velocity); // 2) Create context Java model IContext context = report.createContext(); Project project = new Project("XDocReport"); context.put("project", project); // 3) Generate report by merging Java model with the Docx OutputStream out = new FileOutputStream(new File( "DocxProjectWithVelocity_Out.pdf")); // report.process(context, out); Options options = Options.getTo(ConverterTypeTo.PDF).via( ConverterTypeVia.XWPF); report.convert(context, options, out); } catch (IOException e) { e.printStackTrace(); } catch (XDocReportException e) { e.printStackTrace(); } } }
public static void main(String[] args) { try { // 1) Load Docx file by filling Velocity template engine and cache // it to the registry InputStream in = DocxProjectWithVelocity2XHTML.class .getResourceAsStream("DocxProjectWithVelocity.docx"); IXDocReport report = XDocReportRegistry.getRegistry().loadReport( in, TemplateEngineKind.Velocity); // 2) Create context Java model IContext context = report.createContext(); Project project = new Project("XDocReport"); context.put("project", project); // 3) Generate report by merging Java model with the Docx OutputStream out = new FileOutputStream(new File( "DocxProjectWithVelocity_Out.html")); // report.process(context, out); Options options = Options.getTo(ConverterTypeTo.XHTML).via( ConverterTypeVia.XWPF); report.convert(context, options, out); } catch (IOException e) { e.printStackTrace(); } catch (XDocReportException e) { e.printStackTrace(); } } }
public static void main(String[] args) { try { // 1) Load Docx file by filling Velocity template engine and cache // it to the registry InputStream in = DocxProjectWithVelocity2PDF.class .getResourceAsStream("DocxProjectWithVelocity.docx"); IXDocReport report = XDocReportRegistry.getRegistry().loadReport( in, TemplateEngineKind.Velocity); // 2) Create context Java model IContext context = report.createContext(); Project project = new Project("XDocReport"); context.put("project", project); // 3) Generate report by merging Java model with the Docx OutputStream out = new FileOutputStream(new File( "DocxProjectWithVelocity_Out.pdf")); // report.process(context, out); Options options = Options.getTo(ConverterTypeTo.PDF).via( ConverterTypeVia.XWPF); report.convert(context, options, out); } catch (IOException e) { e.printStackTrace(); } catch (XDocReportException e) { e.printStackTrace(); } } }
Project project = new Project( "XDocReport" ); context.put( "project", project );
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project( "XDocReport" ); context.put( "project", project );
Project project = new Project( "XDocReport" ); context.put( "project", project );
Project project = new Project( "XDocReport" ); context.put( "project", project );
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project("XDocReport"); context.put("project", project);
Project project = new Project( "XDocReport" ); context.put( "project", project ); IImageProvider logo = new ClassPathImageProvider( DocxProjectWithVelocityAndImage.class, "logo.png" );