我正在尝试用我的Java代码覆盖Excel文件:
List <Tuple> copy =
selectFrom(delivery_plan).
list();
int row = 2;
int lastrow2 = main.DeliveredData.getLastRowNum(2);
for(int row2=2; row2<= lastrow2; row2++){
main.DeliveredData.clearCell(2,row2,1);
main.DeliveredData.clearCell(2,row2,2);
main.DeliveredData.clearCell(2,row2,3);
main.DeliveredData.clearCell(2,row2,4);
main.DeliveredData.clearCell(2,row2,5);
main.DeliveredData.clearCell(2,row2,6);
};
//iterating through all entries and saving into our excel sheet
for(Tuple tup : copy){
main.DeliveredData.setCellValue(tup.get(delivery_plan.data),2,row,1);
main.DeliveredData.setCellValue(tup.get(delivery_plan.product),2,row,2);
main.DeliveredData.setCellValue(tup.get(delivery_plan.original_committed_qty),2,row,3);
main.DeliveredData.setCellValue(tup.get(delivery_plan.updated_committe),2,row,4);
main.DeliveredData.setCellValue(tup.get(delivery_plan.min_qty),2,row,5);
main.DeliveredData.setCellValue(tup.get(delivery_plan.max_qty),2,row,6);
row ++;
};
main.DeliveredData.writeFile();
但是,执行我的代码时,出现以下错误消息:
org.apache.xmlbeans.impl.values.XmlValueDisconnectedException java.lang.RuntimeException:org.apache.xmlbeans.impl.values.XmlValueDisconnectedException
我该如何解决这个问题?