Tom,
Thanks for the lovely book with the nice explanations. I am on V5R4M0 and I've POI HSSF version 3.0.2 (poi-3.0.2-FINAL-20080204.jar) downloaded and I this following bit of code:
D workbook s LIKE(HSSFWorkbook)
D sheet s LIKE(HSSFSheet)
D row S LIKE(HSSFRow)
D cell S LIKE(HSSFCell)
*
/Free
JavaServiceProgram();
JNIEnv_P = getJNIEnv();
workbook = new_HSSFWorkbook();
sheet = AirExcel_getSheet(workbook:'Report');
row = AirExcel_getRow(sheet:0);
cell = AirExcel_getCell(row:0);
AirExcel_setCellValueString(cell:'Hello World');
//*** Close the Spreadsheet and Reclaim Resources
AirExcel_write(workbook:'/Adhoc Reports/Test_excel.xls');
....
But the call to HELLOEXCEL is falling over at line AirExcel_setCellValueString(cell:'HELLO WORLD'). I am getting this in my Job Log:
Additional Message Information
Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 11/10/10 Time sent . . . . . . : 10:09:21
Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure AIREXCEL_S in program VENLIB/SVAIREXCEL
received Java exception "java.lang.NoSuchMethodError: setCellValue" when
calling method "setCellValue" with signature
"(Lorg.apache.poi.hssf.usermodel.HSSFRichTextStringV" in class
"org.apache.poi.hssf.usermodel.HSSFCell".
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.
Technical description . . . . . . . . : If the exception indicates that the
Java class was not found, ensure the class for the method is in the class
When I replace the code with AirExcel_setCellValueNumeric(cell:1234) the code works and I able to see a Excel file created with cell0,0 having a value of 1234.
Am I sure why the setCellValueString along is giving the NoSuchMethod error? I checked the Java docs and I see this definition for the setCellValue overridden for a RichString definition:
public void setCellValue(RichTextString value)Set a string value for the cell.
Specified by:
setCellValue in interface Cell
Parameters:
value - value to set the cell to. For formulas we'll set the formula string, for String cells we'll set its value. For other types we will change the cell to a string cell and set its value. If value is null then we will change the cell to a Blank cell.
Thanks for the lovely book with the nice explanations. I am on V5R4M0 and I've POI HSSF version 3.0.2 (poi-3.0.2-FINAL-20080204.jar) downloaded and I this following bit of code:
D workbook s LIKE(HSSFWorkbook)
D sheet s LIKE(HSSFSheet)
D row S LIKE(HSSFRow)
D cell S LIKE(HSSFCell)
*
/Free
JavaServiceProgram();
JNIEnv_P = getJNIEnv();
workbook = new_HSSFWorkbook();
sheet = AirExcel_getSheet(workbook:'Report');
row = AirExcel_getRow(sheet:0);
cell = AirExcel_getCell(row:0);
AirExcel_setCellValueString(cell:'Hello World');
//*** Close the Spreadsheet and Reclaim Resources
AirExcel_write(workbook:'/Adhoc Reports/Test_excel.xls');
....
But the call to HELLOEXCEL is falling over at line AirExcel_setCellValueString(cell:'HELLO WORLD'). I am getting this in my Job Log:
Additional Message Information
Message ID . . . . . . : RNX0301 Severity . . . . . . . : 50
Message type . . . . . : Escape
Date sent . . . . . . : 11/10/10 Time sent . . . . . . : 10:09:21
Message . . . . : Java exception received when calling Java method.
Cause . . . . . : RPG procedure AIREXCEL_S in program VENLIB/SVAIREXCEL
received Java exception "java.lang.NoSuchMethodError: setCellValue" when
calling method "setCellValue" with signature
"(Lorg.apache.poi.hssf.usermodel.HSSFRichTextStringV" in class
"org.apache.poi.hssf.usermodel.HSSFCell".
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.
Technical description . . . . . . . . : If the exception indicates that the
Java class was not found, ensure the class for the method is in the class
When I replace the code with AirExcel_setCellValueNumeric(cell:1234) the code works and I able to see a Excel file created with cell0,0 having a value of 1234.
Am I sure why the setCellValueString along is giving the NoSuchMethod error? I checked the Java docs and I see this definition for the setCellValue overridden for a RichString definition:
public void setCellValue(RichTextString value)Set a string value for the cell.
Specified by:
setCellValue in interface Cell
Parameters:
value - value to set the cell to. For formulas we'll set the formula string, for String cells we'll set its value. For other types we will change the cell to a string cell and set its value. If value is null then we will change the cell to a Blank cell.
Comment