String sp = File.separator; String templatePath = CoreStaticManager.getFileRoot() + "SYSTEM" + sp + "template" + sp + "aaaas.xls";
String fullmyfilename = CoreStaticManager.getFileRoot() + "temp" + sp + "system" + sp + "bom" + sp + Math.random() +".xls"; FileUtil.copyFile(templatePath, fullmyfilename, true); File destFile = new File(fullmyfilename); /*Workbook book = Workbook.getWorkbook(destFile); WritableWorkbook wwbook = Workbook.createWorkbook(destFile, book); Workbook wbb = Workbook.getWorkbook(new File(filePath + filename)); WritableWorkbook wb1 = Workbook.createWorkbook(new File(filePath + filename), wbb); */ FileInputStream in = new FileInputStream(destFile); Workbook book = Workbook.getWorkbook(in); WritableWorkbook wwbook = Workbook.createWorkbook(destFile, book);
这里导出的是 固定文件夹里面的文件,导到固定的地方去