Java的jxl写入excel但是原先excel的内容被清空了
try{FiletempFile=newFile("L:"+java.io.File.separator+"output00.xls");System.out.print...
try{ File tempFile=new File("L:" + java.io.File.separator + "output00.xls");
System.out.println( "L:" + java.io.File.separator + "output00.xls" );
WritableWorkbook workbook = Workbook.createWorkbook(tempFile);
WritableSheet sheet = workbook.createSheet("TestCreateExcel", 0);
l=new Label(0, 0, "用于测试的Excel文件", headerFormat);
sheet.addCell(l);
workbook.write();
workbook.close();
请问是不是还要加什么流来保存原先xls里面内容 请给几行具体代码谢谢 展开
System.out.println( "L:" + java.io.File.separator + "output00.xls" );
WritableWorkbook workbook = Workbook.createWorkbook(tempFile);
WritableSheet sheet = workbook.createSheet("TestCreateExcel", 0);
l=new Label(0, 0, "用于测试的Excel文件", headerFormat);
sheet.addCell(l);
workbook.write();
workbook.close();
请问是不是还要加什么流来保存原先xls里面内容 请给几行具体代码谢谢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询