1 package org.hanei.jaxcel.util;
4 import java.io.FileInputStream;
5 import java.io.InputStreamReader;
6 import java.util.HashMap;
7 import net.arnx.jsonic.JSON;
8 import org.hanei.jaxcel.report.ReportMaker;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
13 public class MakeReportTool {
15 private static final Logger log = LoggerFactory.getLogger(MakeReportTool.class);
18 * ExcelテンプレートファイルにJSONファイルのデータを挿入することでExcel帳票を生成、Excel帳票ファイルを出力する。
20 * @param args arg1: Excelテンプレートファイルパス<br>
21 * arg2: パラメータJSONファイルパス<br>
22 * arg3: Excel帳票出力ファイルパス
26 public static void main(String[] args) throws Exception {
28 if(args.length != 3) {
29 System.out.println("illegal arguments.");
30 System.out.println("arg1: template excel file path");
31 System.out.println("arg2: parameters json file path");
32 System.out.println("arg3: output excel file path");
33 System.out.println("...relative path from the build root. or absolute path");
37 HashMap<String, Object> parameter = JSON.decode(new InputStreamReader(new FileInputStream(new File(args[1])),"UTF-8"));
39 ReportMaker maker = new ReportMaker();
40 log.info("====== makeReport Start ======");
41 maker.makeReport(new File(args[0]), parameter, new File(args[2]));
42 System.out.println("output complate " + args[2]);
43 System.out.println("see debug log ../log/jaxcel.log");
44 log.info("====== makeReport End ======");