gpt4 book ai didi

java - 无法打开使用 jOpenDocument 创建的 ODS 文档 Google 文档

转载 作者:行者123 更新时间:2023-12-01 04:50:25 27 4
gpt4 key购买 nike

我正在尝试使用 jOpenDocument library创建文档。我已经执行了创建电子表格的示例 - 代码编译并运行正常,但当我尝试使用 Excel Office 2012 或 Google Docs 打开文档时,他们向我指出格式不正确。

这是示例,我使用的是 jOpenDocument 1.2 版本:

final Object[][] data = new Object[6][2];
data[0] = new Object[] { "January", 1 };
data[1] = new Object[] { "February", 3 };
data[2] = new Object[] { "March", 8 };
data[3] = new Object[] { "April", 10 };
data[4] = new Object[] { "May", 15 };
data[5] = new Object[] { "June", 18 };

String[] columns = new String[] { "Month", "Temp" };

TableModel model = new DefaultTableModel(data, columns);

// Save the data to an ODS file and open it.
final File file = new File(destpath, "temperature.ods");

SpreadSheet.createEmpty(model).saveAs(file);

最佳答案

好的。使用版本 1.3b1(或更高版本),Excel 2010 可以打开该文件。

但 Google 文档仍然不行。

关于java - 无法打开使用 jOpenDocument 创建的 ODS 文档 Google 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15090854/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com