Topic
1 reply Latest Post - ‏2013-05-15T21:52:48Z by KaranBal
2784
2784
4 Posts
ACCEPTED ANSWER

Pinned topic Exception in createExcelSheet() method

‏2013-04-25T08:52:40Z |

Hi,

I am trying to create a test excel sheet using the below code in sandbox:

function writeCell(row,cellIndex,attrString)
{
    var cell = row.createExcelCell(cellIndex);
    if (null != attrString)
    {
      cell.setCellType("STRING");
      cell.setStringCellValue(attrString);
    }
}

var excelName = "archives/TestExcelSheet.xls";
var book = new ExcelBook();
out.writeln(book);
var sheet = book.createExcelSheet("TestSheet");
out.writeln(sheet);
row = sheet.createRow(0);
writeCell(row,0,"Name");
writeCell(row,1,"Type");
book.saveToDocStore(excelName, true);

 

However, the line:

var sheet = book.createExcelSheet("TestSheet");

is throwing the below exception:

Exception:Script execution failed (java.lang.IncompatibleClassChangeError) Exception:java.lang.IncompatibleClassChangeError
at com.ibm.ccd.common.excel.impl.hssf.ExcelBook.createExcelsheet(ExcelBook.java:238)
at com.ibm.ccd.common.interpreter.operation.generated.GenCreateExcelSheetOperation.execute(GenCreateExcelSheetOperation.java:85)
at WPCScriptSandboxPath13668797651700.run(WPCScriptSandboxPath13668797651700.java:56)

Any idea of the reason?? I am working on MDMCS 10.0.0 FP#5.

Thanks,

Chetan

  • KaranBal
    KaranBal
    108 Posts
    ACCEPTED ANSWER

    Re: Exception in createExcelSheet() method

    ‏2013-05-15T21:52:48Z  in response to 2784

    I ran the same code and it worked fine. Output:

    
    com.ibm.ccd.common.excel.impl.hssf.ExcelBook@44aa44aa
    com.ibm.ccd.common.excel.impl.hssf.Excelsheet@4a154a15
    DONE
    

    Therefore all I can think of is:
    1. You are not overwriting any product supplied classes

    2. Your set-up is accurate in that you can write to the docstore.