在android中使用JXL库编辑Excel工作表

发布于 2024-12-29 12:32:16 字数 601 浏览 2 评论 0 原文

我在应用程序中使用 jxl 库来编辑存储在 Galaxy Tab 外部存储中的 Excel 文件。但每次我尝试编写 Excel 时,它都会创建现有 Excel 文件的副本。它正在正确写入所有值,但我的问题是它没有创建 Excel 文件中存在的其他工作表,这些工作表基于第一个工作表和第二个工作表中的值。一些公式。因此,当我阅读新创建的 Excel 文件副本时,它会显示除第一张纸之外的空白纸页。

            'Workbook workbook = Workbook.getWorkbook(new File(file));
    WritableWorkbook copy = Workbook.createWorkbook(new File(output.xls), workbook);

    WritableSheet sheet0 = copy.getSheet(0);

    WritableCell cell1 = sheet0.getWritableCell(3,4);

      Number n = (Number) cell1; 
      n.setValue(Systemsize);

    copy.write(); 
    copy.close();

谢谢

I am using jxl library in my application to edit excel file stored in external storage of galaxy tab. But every time i try to write the excel it creates a copy of existing excel file.It is writing all the values properly but my problem is that it is not creating other sheets present in excel file which are based on values from first sheet & some formulas. So when i read that newly created copy of excel file it shows me empty sheets other than first sheet.

            'Workbook workbook = Workbook.getWorkbook(new File(file));
    WritableWorkbook copy = Workbook.createWorkbook(new File(output.xls), workbook);

    WritableSheet sheet0 = copy.getSheet(0);

    WritableCell cell1 = sheet0.getWritableCell(3,4);

      Number n = (Number) cell1; 
      n.setValue(Systemsize);

    copy.write(); 
    copy.close();

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文