1金币
本帖最后由 Joestar.Xu 于 2023-11-1 10:07 编辑
产品:GcExcel
版本:6.1.2
问题编号:DOCXLS-9179
public static void main(String[] args) {
String targetPath = "L:\\test\\2001-0006-0001-短期借款利息检查情况表.xlsx";
String sourcePath = "L:\\test\\169873962397281161948b6f462117460.xlsx";
FileOutputStream fos = null;
FileInputStream fis1 = null;
FileInputStream fis2 = null;
try {
fis1 = new FileInputStream(targetPath);
Workbook workbook = new Workbook();
workbook.open(fis1);
fis2 = new FileInputStream(sourcePath);
Workbook workbookSource = new Workbook();
workbookSource.open(fis2);
int count = workbookSource.getWorksheets().getCount();
for (int i = 0; i < count; i++) {
IWorksheet iWorksheet = workbook.getWorksheets().get(workbook.getWorksheets().getCount() - 1);
workbookSource.getWorksheets().get(i).copyAfter(iWorksheet);
}
fos = new FileOutputStream(targetPath);
workbook.save(fos);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != fis1) {
try {
fis1.close();
} catch (Exception var2) {
}
}
if (null != fis2) {
try {
fis2.close();
} catch (Exception var2) {
}
}
if (null != fos) {
try {
fos.close();
} catch (Exception var2) {
}
}
}
}
16:46:26.023 DEBUG [c.g.d.e.bH] -1 Get instance of MypdfGraphics(Use cache): com.grapecity.documents.excel.bH@3d484181
com.grapecity.documents.excel.InvalidFormulaException: The data validation's formula is invalid! [币种]
at com.grapecity.documents.excel.G.aR.a(Unknown Source)
at com.grapecity.documents.excel.G.aR.a(Unknown Source)
at com.grapecity.documents.excel.dQ.a(Unknown Source)
at com.grapecity.documents.excel.dQ.copyAfter(Unknown Source)
at cn.com.bdo.dgCenter.service.GcExcelService.main(GcExcelService.java:2975)
Disconnected from the target VM, address: '127.0.0.1:54207', transport: 'socket' |
最佳答案
查看完整内容
您好,该问题已在6.2.5版本中修复,您可以升级后再测试一下。
|