Skip to Content
0
Sep 05, 2012 at 10:28 PM

JXL WritableWorkbook issues - EmptyStackException thrown on write() method

63 Views

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