on 09-05-2012 11:28 PM
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
i would suggest you go with apache poi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My "test.xls" file is an extensive excel file with rules, formulas and macros...would this cause an issue?
From my experience, JXL does not work well with complicated Excel files.
Is Web Dynrpo Java limited to simple excel files??
No, you can use other 3rd party libraries.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Paskal Singh wrote:
Hi Stefan,
Which 3rd party library do you recommend for more complex excel files? And will it be compatible with Java 1.4.2, Web Dynrpo Java and Netweaver 7.0 sp25?
JXL is the only 3rd party library I have experience with, however from what my colleagues have said, Apache POI works well. You can download an older version of Apache POI that is compatible with Java 1.4.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.