|
I am trying to get this POI thing to create a formula in an Excel spreadsheet cell. JK was kind enough to point me in the right direction (Thanks John). As I am unfamiliar with RPGILE and Java, you can understand that I am "strugling" my way through this.
I added the following PR to the sql2xls program: * Cell.setCellFormula(String) ------------------------
D setCellFormula PR ExtProc(*JAVA D :'org.apache.poi.hssf.usermodel- D .HSSFCell' D :'setCellFormula') D cellFormula O Class(*JAVA D :'java.lang.String')
I then added the following "If" statement to the program:
If %subst(Cell_Alfa:1:1) = '='; setCellType(cell:2); Cell_Alfa = %subst(Cell_Alfa:2:1023); // strip out the '=' string = createString(Cell_Alfa); // create java string tstring = trimString(String); // trim string setCellFormula(cell:tstring); // set cell value Else; setCellType(cell:1); string = createString(Cell_Alfa); // create java string tstring = trimString(String); // trim string setCellValStr(cell:tstring); // set cell value EndIf; freeJavaObject(env:string);
When I try to run the program, I get the following error:
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.