I have found one template, that i unable to reload via streams. We used some like this code for our purposes. There is part of real code, but it does not works. Can you please help me - what wrong with this template?
public void openWorkbook() throws Exception {
//Success
reload(new Workbook(“D://2.xlsx”));
//Failed
reload(new Workbook(“D://1.xlsx”));
}
private void reload(Workbook wb) throws Exception {
try (ByteArrayOutputStream byteOut = new ByteArrayOutputStream()) {
wb.save(byteOut, wb.getFileFormat());
byteOut.flush();
wb = new Workbook(new ByteArrayInputStream(byteOut.toByteArray()));
System.out.println(wb.getWorksheets().getCount());
}
}
I have received floowing output:
4
java.lang.NumberFormatException: For input string: “0,001”
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1241)
at java.lang.Double.parseDouble(Double.java:540)
at com.aspose.cells.b.a.o.a(Unknown Source)
at com.aspose.cells.ajq.D(Unknown Source)
at com.aspose.cells.aci.f(Unknown Source)
at com.aspose.cells.aci.a(Unknown Source)
at com.aspose.cells.acg.h(Unknown Source)
at com.aspose.cells.acg.a(Unknown Source)
at com.aspose.cells.acf.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.(Unknown Source)
at com.asuproject.usoi.report.aspose.AsposeBookAdapterTest.reload(AsposeBookAdapterTest.java:70)
at com.asuproject.usoi.report.aspose.AsposeBookAdapterTest.openWorkbook(AsposeBookAdapterTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)