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
661

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
junwu
SAP Champion
SAP Champion
0 Likes

i would suggest you go with apache poi.

paskal_singh
Explorer
0 Likes

Hi Jun,

Is Apache POI compatible with Java 1.4.2 and Web Dynpro Java for NetWeaver 7.0 SP25?