我有 2 个要写在同一个 excel 文件中的工作簿,以下是我的代码
public void csvWriteToFile(HSSFWorkbook workbook1,HSSFWorkbook workbook2,String fileName){
try {
FileOutputStream out = new FileOutputStream(new File(fileName));
workbook1.write(out);
workbook2.write(out);
out.close();
System.out.println("Excel written successfully..");
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
这只会在 excel 文件中创建一张表..我在这里做错了什么..?