cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

JXL WritableWorkbook issues - EmptyStackException thrown on write() method

paskal_singh
Explorer
0 Likes
659

Hi Experts,

I have a web dynpro java application that reads in an excel 97 format template and is attempting to write some cells before allowing the user to download it. However, a EmptyStackException is thrown when the write() method is invoked on the Workbook object. Here is a code excerpt:

[code]

IWDWebResource webResource = WDWebResource.getWebResource(wdComponentAPI.getDeployableObjectPart(), WDWebResourceType.XLS,

"test.xls"

);

try

{

      Workbook excelTemplateFromMimes = Workbook.getWorkbook(webResource.read(false);

      ByteArrayOutputStream baos = new ByteArrayOutputStream();

      WritableWorkbook workbook = Workbook.createWorkbook(baos, excelTemplateFromMimes);

      WritableSheet sheet = workbook.getSheet(0);

     

      // do some cell inserts of data

      workbook.write();   //This is the line causing the EmptyStackException

      workbook.close();

}

catch(Exception e)

{

}

[/code]

Any ideas why this might be happening?? I created an empty template "Book1.xls" and it works no issues with that. My "test.xls" file is an extensive excel file with rules, formulas and macros...would this cause an issue? Is Web Dynrpo Java limited to simple excel files?? I'm on Portal 7.0 sps 25, same with NWDS version.

Any suggestions are very welcome.

PS

View Entire Topic
paskal_singh
Explorer
0 Likes

Hi All,

Thanks for replying.

I'm going to download Apache POI v3.2 (current release is v3.8). I believe this might be the version compatible with the current Java stack we are on (1.4.2). Please let me know otherwise.

PS

junwu
SAP Champion
SAP Champion
0 Likes

POI 3.5 and later requires the JDK version 1.5 or later. Versions prior to 3.5 require JDK 1.4+

3.2 should be good