gpt4 book ai didi

android - 在 Android 中使用 org.apache.poi.ss.examples.html.ToHtml.create(...) 会崩溃

转载 作者:行者123 更新时间:2023-12-02 01:51:06 25 4
gpt4 key购买 nike

尝试使用 org.apache.poi.ss.examples.html.ToHtml.create(...) 将 Excel 文件转换为 Html 时,调用因异常而崩溃

02-28 13:16:06.559: I/dalvikvm(8010): Could not find method org.apache.poi.ss.usermodel.WorkbookFactory.create, referenced from method org.apache.poi.ss.examples.html.ToHtml.create

String xlsxFile = "/sdcard/book1.xlsx";
String htmlFile = "/sdcard/download/out.html";

try {

FileWriter fw = new FileWriter(htmlFile);
org.apache.poi.ss.examples.html.ToHtml.create(xlsxFile, new PrintWriter(fw));
} catch (IOException e2) {
// TODO Auto-generated catch block
e2.printStackTrace();
}

最佳答案

看起来您的类路径上没有所有必需的 jar。请参阅POI Components Page获取您需要的 jar 列表。 (如果您下载了 POI 二进制版本,则其中包含所有这些内容,或者如果您使用 Maven,它会为您下载它们。)

具体来说,在您的情况下,您缺少 poi-ooxml jar,也可能缺少它的依赖项 - 请参阅 components page查看其中的列表。

关于android - 在 Android 中使用 org.apache.poi.ss.examples.html.ToHtml.create(...) 会崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9480989/

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