我得到了一个必须填写的 Excel 工作表,所以我使用 JExcel 来为我填写。但是,当我使用 JExcel 仅填充一个单元格时,它可以工作,但我会收到一大堆不必要的警告,这些警告会滞后于所有内容(我假设这是因为 excel 文件中包含所有元数据)。有谁知道如何在不删除元数据的情况下避免这些警告?(我需要保留元数据,因为我假设它对于解析另一端填充的 Excel 工作表很重要)
非常感谢您的帮助!
public static void main(String args[]){
Workbook workbook;
try{
workbook = Workbook.getWorkbook(new File("Test.xls"));
WritableWorkbook copy = Workbook.createWorkbook(new File("output.xls"), workbook);
WritableSheet sheet1 = copy.getSheet(0);
Label label = new Label(4,5, "PO1234355");
sheet1.addCell(label);
copy.write();
copy.close();
}
catch(Exception e){
System.out.println("Could not get workbook. Error: " + e.toString());
}
}
这些是我得到的疯狂警告:
Warning: Cannot read name ranges for BUY - setting to empty
Warning: Cannot read name ranges for Buyer - setting to empty
Warning: Cannot read name ranges for Casual_Buyer - setting to empty
Warning: Cannot read name ranges for Departments - setting to empty
Warning: Cannot read name ranges for Dept_No - setting to empty
Warning: Cannot read name ranges for Designer - setting to empty
Warning: Cannot read name ranges for Model - setting to empty
Warning: Cannot read name ranges for Seasons - setting to empty
Warning: Cannot read name ranges for Supplier - setting to empty
Warning: Cannot read name ranges for Technologist - setting to empty
Warning: Cannot read name ranges for Typed_by - setting to empty
Warning: Cannot read name ranges for YESNO - setting to empty
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing
Warning: no filename property for drawing