× 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.



Hi John,

Your 'forceRecalc1' prototype looks correct to me (though, I haven't actually tried it.)

d forceRecalc1 pr
d extproc(*JAVA
d :'org.apache.poi.hssf.usermodel-
d .HSSFWorkbook'
d :'setForceFormulaRecalculation')
d argBoolean 1n value

You would then call this prototype as:

forceRecalc1( book: *on );

Even though there's no parameter declared for 'book' on the prototype, the fact that you are calling a non-static Java method *implies* that the first parameter must be an object of the HSSFWorkbook class. So you don't code it on the prototype, but it's still required.

-SK


On 4/3/2012 1:48 PM, John Rusling wrote:
Thanks for explaining that Scott.

With that change, I did get it to compile. Then when I added the
call to it - wouldn't compile and gave me this message -

*RNF5406 30 1 The call passed fewer parameters than the prototype indicates
are required.
*RNF7588 30 1 The first parameter for a non-static Java method call must be
an Object.

This led me to think that 'book' should be the first parameter (even though the poi
documentation only called for (Boolean value), )
so I copied it to forceRecalc2 and added the 'book' parameter back in and tried
call forceRecalc2 thus -

forceRecalc2(book:myTrue);

It now won't recompile with this message -

*RNF5406 30 1 The call passed fewer parameters than the prototype indicates
are required.
*RNF7536 30 1 The type of the parameter specified for the call does not
match the prototype.

I'll paste the code in and if anyone has an idea. I trimmed off the fat so's
All that's needed to compile POI36 library and an HSSF bnddir in POI36.

I'm in a boat, I have one paddle... (you know where I'm going)<g>

Thanks,

John



Hi John,

I haven't used this method (which is why it's not in HSSFR4).
I typically only add code like this when I need it, and I expect
that others will do the same when they find a need.

The "boolean" value on an RPG prototype should be an indicator. (RPG data type N).
RPG will automatically translate this to a Java boolean (jBoolean) under the covers.
Only use the jBoolean value in QSYSINC/QRPGLESRC,JNI if you are calling the
method via JNI (as opposed to writing a prototype.) For a prototype, use an indicator.

-SK


h dftactgrp(*no) actgrp(*new)
h option(*srcstmt: *nodebugio: *noshowcpy)
h thread(*SERIALIZE)
h bnddir('HSSF')

/copy hssf_h

d book s like(SSWorkbook)
d sheet s like(SSSheet)
d row s like(SSRow)
d cell s like(SSCell)
d TempStr s like(jString)

d gRow s 10i 0
d gColumn s 10i 0

d gFilename...
d s 100 varying
d gSheetname...
d s 100 varying

d forceRecalc1 pr
d extproc(*JAVA
d :'org.apache.poi.hssf.usermodel-
d .HSSFWorkbook'
d :'setForceFormulaRecalculation')
d argBoolean 1n value

d forceRecalc2 pr
d extproc(*JAVA
d :'org.apache.poi.hssf.usermodel-
d .HSSFWorkbook'
d :'setForceFormulaRecalculation')
d book like(SSWorkbook) const
d argBoolean 1n value

d myTrue s n inz(*on)

/free

ss_begin_object_group(100);

gFilename = 'myss01.xlsx';
gSheetname = 'Sheet1';

//-
// Load an existing spreadsheet into memory
//-
book = ss_open('/johnr' + '/' + gFilename);
if (book = *null);
Complain('Unable to open workbook!');
endif;


1 // forceRecalc1(myTrue);
2 // forceRecalc2(book:myTrue);


//-
// Set the worksheet to update
//-
sheet = ss_getSheet(book: gSheetname);
if (sheet = *null);
Complain('No Sheet1 sheet in workbook!');
endif;


gRow = 2;
gColumn = 0;
//---
dou ('6' = '9');

//-
// Get the row
//-
row = SSSheet_getRow(sheet: gRow);
// Find that row is not *null
if (row = *null);
row = SSSheet_createRow(sheet: gRow);
endif;

//-
// Column 0 - String label
//-
cell = SSRow_GetCell(row: gColumn);
if (cell = *null);
cell = SSRow_createCell(row: gColumn);
endif;
// Update the cell
SSCell_setCellType(cell: CELL_TYPE_STRING);
TempStr = new_String('Seven');
SSCell_setCellValueStr(cell: TempStr);


//-
// Column 1 - Numeric value
//-
gColumn += 1;
cell = SSRow_GetCell(row: gColumn);
if (cell = *null);
cell = SSRow_createCell(row: gColumn);
endif;
// Update the cell
SSCell_setCellType(cell: CELL_TYPE_NUMERIC);
SSCell_setCellValueD(cell: 7.50);

leave;
enddo;
//----


ss_save(book: '/johnr' + '/' + gFilename);
ss_end_object_group();

*inlr = *on;
return;

/end-free

//===============================================================
p complain...
p b
d pi
d msg 256a varying const

//
//===============================================================

d QMHSNDPM pr extpgm('QMHSNDPM')
d MessageID 7 const
d QualMsgF 20 const
d MsgData 256 const options(*varsize)
d MsgDtaLen 10i 0 const
d MsgType 10 const
d CallStkEnt 10 const
d CallStkCnt 10i 0 const
d MessageKey 4
d ErrorCode 8192 options(*varsize)

d ErrorCode ds qualified
d BytesProv 10i 0 inz(0)
d BytesAvail 10i 0 inz(0)

d MsgKey s 4

/free

QMHSNDPM( 'CPF9897'
: 'QCPFMSG *LIBL'
: msg
: %len(msg)
: '*ESCAPE'
: '*PGMBDY'
: 1
: MsgKey
: ErrorCode );

/end-free
p e


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.