本帖最后由 Joestar.Xu 于 2023-10-26 11:02 编辑
产品:GcExcel
版本:6.2.1
问题编号:DOCXLS-9153
public static void main(String[] args) {
String path = "L:\\test\\test.xlsx";
FileInputStream fis = null;
FileOutputStream fos = null;
try {
// Create a new workbook
Workbook workbook = new Workbook();
fis = new FileInputStream(path);
workbook.open(fis);
fos = new FileOutputStream(path);
// Save to an Excel file
workbook.save(fos);
} catch (Exception e) {
e.printStackTrace();
} finally {
if(fis != null){
try {
fis.close();
} catch (Exception var2) {
}
}
if(fos != null){
try {
fos.close();
} catch (Exception var2) {
}
}
}
}
10:26:39.105 DEBUG [c.g.d.e.bH] -1 Get instance of MypdfGraphics(New): com.grapecity.documents.excel.bH@3d484181
java.lang.NullPointerException
at com.grapecity.documents.excel.l.h.a(Unknown Source)
at com.grapecity.documents.excel.l.i.a(Unknown Source)
at com.grapecity.documents.excel.l.h.T(Unknown Source)
at com.grapecity.documents.excel.l.h.R(Unknown Source)
at com.grapecity.documents.excel.l.h.C(Unknown Source)
at com.grapecity.documents.excel.G.aM.bO(Unknown Source)
at com.grapecity.documents.excel.Workbook.a(Unknown Source)
at com.grapecity.documents.excel.Workbook.save(Unknown Source)
at cn.com.bdo.dgCenter.service.GcExcelService.main(GcExcelService.java:2941)
Disconnected from the target VM, address: '127.0.0.1:54890', transport: 'socket'
Process finished with exit code 0
什么原因导致保存报错??? |
|