在输出流类中创建 excel 文件时,使用 Excel 工作簿名称创建工作表。我开发的代码如下。请让我知道正确的代码以满足我的要求。
FileInputStream fi =new FileInputStream(System.getProperty("user.dir")+"\\src\\com\\ode\\resources\\Admin_Login.xls");
Workbook wb = Workbook.getWorkbook(fi);
Sheet sh = wb.getSheet("AdminUserLogin");
Sheet sh1 = wb.getSheet("FieldValidations_Zip");
System.out.println("<><><><><> "+sh1.getName());
//Create the Result xls file
FileOutputStream fo = new FileOutputStream("Admin_Login_Results_"+cdate+".xls");
//FileOutputStream fo = new FileOutputStream(System.getProperty("user.dir")+"\\src\\com\\ode\\resources\\output\\Admin_Login_Results_"+cdate+".xls");
WritableWorkbook wwb = Workbook.createWorkbook(fo);
WritableSheet ws = wwb.createSheet("FieldValidations_Zip", 0);
Thread.sleep(Admin_zipcode);
帮助将不胜感激!