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



Hello K,

This would be RPG code that you'd put in your own program/library.

You mention "LIBHTTP" which is a library name I typically use for HTTPAPI -- which is completely unrelated to POI/XSSF.  So I'm not sure where that came from?

But, I would not insert it into any 3rd party tool like POI/HSSF/XSSF or HTTPAPI, because then when you update those packages, you'll lose that code.  Instead, put it into your own library (-ies) where it's kept with all of your other code that you write for your company.

Does that make sense?


On 6/23/22 11:07 AM, K Crawford wrote:
I found this thread from March of 2019 by Darrren S.
I would like to use this but am a bit confused. I am confused on where to
put this code. Do I put it in one of the members in the LIBHTTP library?
Or in one of the POI36 members? Or in my program that is building the
XLSX? Or create something new?

This is the code he posted.

dcl-c XSSFColor_CLASS
'org.apache.poi.xssf.usermodel.XSSFColor';
dcl-c Color_CLASS
'java.awt.Color';

DCL-PR new_XSSFColor
OBJECT(*JAVA: XSSFColor_CLASS)
EXTPROC(*JAVA : XSSFColor_CLASS
: *CONSTRUCTOR );
Color OBJECT(*JAVA : Color_CLASS);
END-PR ;

dcl-pr New_Color
object(*JAVA:Color_CLASS)
extproc(*JAVA:Color_CLASS
:*CONSTRUCTOR);
red like(jint) value;
green like(jint) value;
blue like(jint) value;
end-pr;

dcl-pr XSSF_setFillForegroundColor
extproc(*JAVA
: 'org.apache.poi.xssf.usermodel.XSSFCellStyle'
: 'setFillForegroundColor');
XSSFColor object(*JAVA: XSSFColor_CLASS);
end-pr;

dcl-s ClrObj object(*JAVA:Color_CLASS);
dcl-s XSSFColor OBJECT(*JAVA: XSSFColor_CLASS);
_________________________
Example call:
ClrObj=New_Color(200:200:200);
XSSFColor=New_XSSFColor(ClrObj);

// Create a cell style for wrapped column headings.
// These are bold and have a border line at the bottom
ColWrapped = SSWorkbook_createCellStyle(book);
ssCellStyle_setFont(ColWrapped: WhiteFont);
SSCellStyle_setWrapText(ColWrapped:*On);
SSCellStyle_setAlignment(ColWrapped: ALIGN_CENTER);
XSSF_setFillForegroundColor(ColWrapped:XSSFColor);
ssCellStyle_setFillPattern(ColWrapped: SS_PATTERN_SOLID_FOREGROUND);
callp $SetAllBorder(ColWrapped:BORDER_THIN);


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.