When trying to convert excel file to Html using org.apache.poi.ss.examples.html.ToHtml.create(…), the call crashes with exception
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();
}
Looks like you don’t have all the required jars on your classpath. See the POI Components Page for the list of the Jars you need. (If you downloaded a POI binary release, you’ll have all of them in there, or if you use Maven it’ll download them for you.)
Specifically, in your case, you’re missing the poi-ooxml jar, and possibly its dependencies too – see the components page for the list of those.