HI,
I am new in aspose, I am having problem open an Excel file. here is the code :
workbook.open(new FileInputStream(“C:\workspace\dues\web\WEB-INF\book1.xlsx”), FileFormatType.XLSX);
Worksheets worksheets = workbook.getWorksheets();
Worksheet worksheet = worksheets.getSheet(0);
AddHVPageBreaks(worksheet);
it breaks at workbook.open. And this is the error from my console
java.lang.InternalError: erroneous handlers
at com.aspose.cells.Workbook.open(Unknown Source)
at org.ici.dues.servlets.PageBreaks.CreateStaticReport(PageBreaks.java:6
5)
at org.ici.dues.servlets.PageBreaks.doGet(PageBreaks.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
Truncated. see log file for complete stacktrace
The Excel file is the one comes with the ASPOSE example which is attached.
Any help is greatly appreciated.
Regards
I download the jar file aspose-cells-2.5.4.14.jar from the JDK 5.0 folder since I am using jdk 1.5 in my program. Yet, I still have the same error:
<Jul 21, 2011 10:22:30 AM EDT> <[weblogic.servlet.in
ternal.WebAppServletContext@2a67a5d - appName: ‘dues’, name: ‘dues’, context-pat
h: ‘/dues’] Root cause of ServletException.
java.lang.InternalError: erroneous handlers
at com.aspose.cells.Workbook.open(Unknown Source)
at org.ici.dues.servlets.PageBreaks.CreateStaticReport(PageBreaks.java:6
7)
at org.ici.dues.servlets.PageBreaks.doGet(PageBreaks.java:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
Truncated. see log file for complete stacktrace
>
Here is the code and it breaks in the workbook.open…
Thanks in advance…
private void CreateStaticReport(OutputStream out, String template_file_path) throws IOException
{
Workbook workbook = new Workbook();
workbook.open(new FileInputStream(“C:\workspace\dues\web\WEB-INF\book1.xlsx”), FileFormatType.XLSX);
Worksheets worksheets = workbook.getWorksheets();
Worksheet worksheet = worksheets.getSheet(0);
AddHVPageBreaks(worksheet);
//Saving the Excel file
workbook.save(out);
//
}
Hi,
Please let us know your code inside this function so that we could investigate this issue further.
AddHVPageBreaks(worksheet);
Hi,
Thank you for your prompt response.
This program was originally from your example , I made some changes just to test it. As I mentioned, it breaks in the Workbook.open method so I was never able to reach the function AddHVPageBreaks(worksheet).
Thanks !
Here is the code :
private void AddHVPageBreaks(Worksheet worksheet)
{
//Add page break
worksheet.addPageBreaks(“B2”);
//or
worksheet.getHPageBreaks().add(“B12”);
worksheet.getVPageBreaks().add(“B12”);
}
Hi,
But, it is opening fine. Below is my code. I have also converted it to pdf using Aspose.Cells for Java. Did you try the latest version Aspose.Cells for Java v2.5.4.14
Java
String path=“F:\Shak-Data-RW\Downloads\book1.xlsx”;
Workbook workbook = new Workbook();
workbook.open(path);
workbook.save(path + “.out.pdf”, FileFormatType.PDF);
Hi,
It works after I add dom4j.jar to my lib folder.
Thanks !
J
Hi,
Its great to know your issue has been fixed now.