|
Hi Matt, I wondered about that. The method does say (short bg), and I wasn't clear on what "bg" meant. I did try creating an HSSFColor object, but couldn't figure out how to assign it a specific color. More reading made it look like I have to create an HSSFColor.LIGHT_GREEN object, but in any case, neither of those appear to be what setFillBackgroundColor is expecting as a parameter, unless maybe it's expecing two parameters, a short integer and a background color object. If that's true, then what does the short integer indicate? And how do I create an appropriate background color object? Can you tell I don't know much about Java? tia, Peter Dow Dow Software Services, Inc. 909 793-9050 voice 909 793-4480 fax 951 522-3214 cell ----- Original Message ----- From: "Haas, Matt" <Matt.Haas@xxxxxxxxxxx> To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> Sent: Sunday, December 05, 2004 12:53 PM Subject: RE: Using Java in RPGLE - setFillBackgroundColor > Peter, > > I think you need to create a background color object and pass that in. > > Matt > > -----Original Message----- > From: Peter Dow [mailto:maillist@xxxxxxxxxxxxxxx] > Sent: Sunday, December 05, 2004 1:40 PM > To: RPG400-L@xxxxxxxxxxxx > Subject: Using Java in RPGLE - setFillBackgroundColor > > > Hi All, > > I'm creating a spreadsheet from an RPGLE program, using Scott Klement's > service program and prototypes (thanks Scott!) and discovered the only color > stuff provided is for setting the color of the font, and only the color red > or automatic. No problem I thought, I'll just go to the Jakarta POI HSSF > website (http://jakarta.apache.org/poi/hssf/index.html) and figure it out. > There's a sample in Java: > > Fills and colors > HSSFWorkbook wb = new HSSFWorkbook(); > HSSFSheet sheet = wb.createSheet("new sheet"); > > // Create a row and put some cells in it. Rows are 0 based. > HSSFRow row = sheet.createRow((short) 1); > > // Aqua background > HSSFCellStyle style = wb.createCellStyle(); > style.setFillBackgroundColor(HSSFColor.AQUA.index); > style.setFillPattern(HSSFCellStyle.BIG_SPOTS); > HSSFCell cell = row.createCell((short) 1); > cell.setCellValue("X"); > cell.setCellStyle(style); > > After looking at the Java definition for setFillbackgroundColor > > java.lang.Object > org.apache.poi.hssf.usermodel.HSSFCellStyle > > Method: > void setFillBackgroundColor(short bg) > set the background fill color. > > I added a prototype for setFillBackgroundColor to Scott's HSSF_H source > member: > > D HSSFCellStyle_setFillBackgroundColor... > D PR EXTPROC(*JAVA > D :'org.apache.poi.hssf.usermodel- > D .HSSFCellStyle' > D :'setFillBackgroundColor') > D color 5I 0 value > > I'm not sure what the "bg" means in (short bg), but the above compiled just > fine. I then use it to set the background color of a cell style: > > HSSFCellStyle_setFillBackgroundColor(ColHeading: COLOR_RED); > > and apply the cell style to a cell: > > hssf_text( row: 0 : 'Description': ColHeading); > > however, the resulting spreadsheet has all the other attributes of > ColHeading (bold, border, font color, etc) but not the background color. > > What am I missing? > > Peter Dow > Dow Software Services, Inc. > 909 793-9050 voice > 909 793-4480 fax > 951 522-3214 cell > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.802 / Virus Database: 545 - Release Date: 12/2/2004 > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > > -- > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list > To post a message email: RPG400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l > or email: RPG400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/rpg400-l. > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.802 / Virus Database: 545 - Release Date: 12/2/2004
As an Amazon Associate we earn from qualifying purchases.
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.