×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I have a question regarding implementation of the Excel function "=PROPER"
using POI. I have successfully applied POI in numerous programs so I can create
spreadsheets that I then e-mail out to users. I have tried, without success, to
implement the Excel function "=PROPER".
The error I receive, upon execution of my program, is "Java exception received
when calling Java method (C G D F)."
Here are the pertinent sections of code. File DB0101 is the A/R Master that
contains names and addresses. The intent of the introduction of the PROPER
function is to include a column of cells that contain the name in mixed case
(where initially the name is stored in all capital letters).
H DEBUG DFTNAME(BA0215) OPTION(*NODEBUGIO) DFTACTGRP(*NO) BNDDIR('HSSF')
H THREAD(*SERIALIZE)
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* USE THE FOLLOWING COMMAND TO CREATE THIS PROGRAM:
* CRTBNDRPG PGM(PRDEXC/BA0215) SRCFILE(PRDSRC/QRPGLESRC)
* DFTACTGRP(*NO) ACTGRP(HFFSR4)
*--------------------------------------------------------------------*
*
FDB0101L IF E K DISK
*
D POS1 S 5U 0
D POS2 S 5U 0
D NUM1 S 5U 0
D NUM2 S 5U 0
D Row# S 5I 0
*
D TabNam S 31A VARYING
D Str S LIKE(jString)
D Str2 S LIKE(jString)
D Str3 S LIKE(jString)
D Book S LIKE(HSSFWorkbook)
D Sheet S LIKE(HSSFSheet)
D row S LIKE(HSSFRow)
D cell S LIKE(HSSFCell)
D outfile S LIKE(jFileOutputStream)
D Left S LIKE(HSSFCellStyle)
D valueChr S 1024A
D Rlacct S 16A
D Rlfrnm S 25A
D Rllsnm S 25A
D Rladdr S 28A
D Rlcity S 13A
D Rlstat S 2A
D Rlzipc S 5A
D Rlactd S 10A
*
D SPRTAB C CONST('SPREADSHEET TAB NAME')
D Apos C CONST(x'7D')
*
D*COPY QSYSINC/QRPGLESRC,JNI
D/COPY QRPGLECPY,HSSF_H
*
C *IN99 DOUEQ *ON
*
C GETRCD TAG
*
C READ DB0101R 99
C *IN99 CABEQ *ON ENDRCD LR
*
C CLEAR POS1
C CLEAR POS2
C SUBNAM IFNE *BLANKS
C EVAL POS1 = %SCAN(',':SUBNAM)
C ENDIF
C POS1 IFEQ 0
C EVAL RLFRNM = SUBNAM
C EVAL RLLSNM = *BLANKS
C GOTO PRCADDR
C ENDIF
C POS1 IFEQ 25
C EVAL RLFRNM = *BLANKS
C EVAL RLLSNM = %SUBST(SUBNAM:1:24)
C GOTO PRCADDR
C ENDIF
C EVAL POS2 = POS1 + 1
C EVAL NUM1 = 26 - POS2
C EVAL NUM2 = POS1 - 1
C EVAL RLFRNM = %TRIM(%SUBST(SUBNAM:POS2:NUM1))
C NUM2 IFNE 0
C EVAL RLLSNM = %TRIM(%SUBST(SUBNAM:1:NUM2))
C ELSE
C EVAL RLLSNM = *BLANKS
C ENDIF
*
C PRCADDR TAG
*
* I have omitted code which would create column headings. The following
code deals with creating from the second row onward.
*
/free
HSSFSheet_setColumnWidth(Sheet:0:16*256);
Row# = Row# + 1;
Row = HSSFSheet_createRow(Sheet:Row#);
Cell = HSSFRow_createCell(Row:0);
Left = HSSFWorkbook_createCellStyle(Book);
HSSFCellStyle_setAlignment(Left:ALIGN_LEFT);
HSSFCell_setCellType(Cell:CELL_TYPE_STRING);
Str2 = new_String(RLACCT);
HSSFCell_setCellValueStr(Cell:Str2);
HSSFCell_setCellStyle(Cell:Left);
The problem occurs on the line which states: "
HSSFCell_setCellFormula(Cell:Str2);".
Can anyone determine why I get the "Java exception received when calling Java
method." error message and what I need to change to allow the code to run?
Thanks to anyone who can help.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.