找回密码
 立即注册

QQ登录

只需一步,快速开始

jin.ye
金牌服务用户   /  发表于:2023-10-26 10:32  /   查看:1279  /  回复:10
本帖最后由 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



什么原因导致保存报错???

test.xlsx

101.26 KB, 下载次数: 55

评分

参与人数 1金币 +200 收起 理由
Joestar.Xu + 200 感谢支持~

查看全部评分

10 个回复

倒序浏览
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-10-26 10:58:49
沙发
本帖最后由 Joestar.Xu 于 2023-10-26 11:02 编辑

您好,问题已重现,这边调研一下,后续有进展我会在本贴中回复您。

问题编号:DOCXLS-9153
SpreadJS 17.0.8 | GcExcel 7.1.0 已发布~
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-10-30 10:45:01
板凳
您好,经调研,这是因为您的文件中有一个命名的定义有误,1.1编制发出商品明细表!$1:$15 中在1.1处有一个小数点,所以需要用括号包裹起来,即'1.1编制发出商品明细表'!$1:$15,您重新保存文件后,该问题即可解决。
SpreadJS 17.0.8 | GcExcel 7.1.0 已发布~
回复 使用道具 举报
jin.ye
金牌服务用户   /  发表于:2023-10-30 11:08:40
地板
Joestar.Xu 发表于 2023-10-30 10:45
您好,经调研,这是因为您的文件中有一个命名的定义有误,1.1编制发出商品明细表!$115 中在1.1处有一个小 ...

image.png68521422.png
哪里
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-10-30 11:18:16
5#
在显示上是没有问题的,将您的文件解压后解析相关代码会看到:

image.png916795043.png

重新保存后:

image.png62086180.png

所以目前只能通过重新保存来修复这个问题。
SpreadJS 17.0.8 | GcExcel 7.1.0 已发布~
回复 使用道具 举报
jin.ye
金牌服务用户   /  发表于:2023-10-30 11:27:39
6#
Joestar.Xu 发表于 2023-10-30 11:18
在显示上是没有问题的,将您的文件解压后解析相关代码会看到:

gc能否打开保存的时候,像Excel一样自动修复,该文件是由用户上传的,我们无法控制用户的操作习惯
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-10-30 11:38:16
7#
明白了,我们向产品反馈一下这个问题,本帖先移至产品需求板块,后续有进展我会在本帖中再回复您。
SpreadJS 17.0.8 | GcExcel 7.1.0 已发布~
回复 使用道具 举报
Joestar.XuSpreadJS 开发认证
超级版主   /  发表于:2023-10-31 09:58:56
8#
您好,GcExcel 是后端电子表格控件而非像Excel一样的应用程序。我们无法知道Excel文件是如何生成的,所以目前来说只能给出更详细的错误信息,让您知道文件的哪里出了问题。

在后续版本中我们会对该问题的报错信息进行优化,使其更加清晰。
SpreadJS 17.0.8 | GcExcel 7.1.0 已发布~
回复 使用道具 举报
Lynn.Dou讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2023-11-16 14:08:03
9#
更新进展:
关于“在后续版本中我们会对该问题的报错信息进行优化,使其更加清晰。”
此问题已在V6.2.4修复,您可以升级测试下。
回复 使用道具 举报
jin.ye
金牌服务用户   /  发表于:2023-11-17 17:49:26
10#
Lynn.Dou 发表于 2023-11-16 14:08
更新进展:
关于“在后续版本中我们会对该问题的报错信息进行优化,使其更加清晰。”
此问题已在V6.2.4修 ...


com.grapecity.documents.excel.InvalidFormulaException: The formula in defined names is invalid! [1.1编制发出商品明细表!$115]
        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)

这个修复啥了,升级之后保存还是报错啊
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部