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



On 4/3/2012 8:49 AM, John Rusling wrote:
I have a tax program (rpg) that's populating an excel spreadsheet, multiple sheets. I'm using the hssfr4 service program to do this.

I'd like the entire workbook to recalculate when the user opens it.

I've scammed thru the poi documentation and figure that setForceFormulaRecalculation is what I'm looking for to have the spreadsheet auto recalculate the next time it is opened.

I don't see that setForceFormulaRecalculation is 'wrapped' in the hssfr4 service program anywhere.

I'm taking a stab at doing it myself (sigh), looking at examples, trial and error but to sum up, I'm feeling pretty stupid! (again)

I came up with this this morning - Oddly it calls for a Boolean value but won't let me use that as a parm.
When I added (work)book as a parm and commented out TorF, then it compiled fine.

d forceRecalc pr
d extproc(*JAVA
d :'org.apache.poi.hssf.usermodel-
d .HSSFWorkbook'
d :'setForceFormulaRecalculation')
d book like(SSWorkbook) const
d**TorF like(jBoolean) value


Has anyone used the set force formula recalculation in RPG?

Can anyone share the correct way to use RPG to prototype and use set force formula recalculation?

Any help is greatly appreciated, thanks.

John



http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Workbook.html#setForceFormulaRecalculation%28boolean%29

setForceFormulaRecalculation

void setForceFormulaRecalculation(boolean value)

Whether the application shall perform a full recalculation when the workbook is opened.

Typically you want to force formula recalculation when you modify cell formulas or values of a workbook previously created by Excel. When set to true, this flag will tell Excel that it needs to recalculate all formulas in the workbook the next time the file is opened.

Note, that recalculation updates cached formula results and, thus, modifies the workbook. Depending on the version, Excel may prompt you with "Do you want to save the changes in filename?" on close.

Parameters:
value - true if the application will perform a full recalculation of workbook values when the workbook is opened
Since:
3.8




This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2019 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].