From: "Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 11/29/2016 06:33 AM
Subject: Re: Has anyone done TAB colors for HSSF POI?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Try to redefine
D XSSF_SHEET_CLASS...
D C 'org.apache.poi.xssf.usermodel-
D .XSSFWorkbook'
as
D XSSF_SHEET_CLASS...
D C 'org.apache.poi.xssf.usermodel-
D .XSSFSheet'
So use XSSFSheet vs. XSSFWorkbook. That is where the method is.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----broehmer@xxxxxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: broehmer@xxxxxxxxxxxxxxx
Date: 11/28/2016 03:30PM
Subject: Re: Has anyone done TAB colors for HSSF POI?
Mark, FYI:
I changed my original hssf_h to include:
D XSSF_SHEET_CLASS...
D C 'org.apache.poi.xssf.usermodel-
D .XSSFWorkbook'
D XSSFSheet_setTabColor...
D PR ExtProc(*JAVA
d : XSSF_SHEET_CLASS
d : 'setTabColor')
D type like(jint) value
and then in my test program I used:
XSSFsheet_SetTabcolor(sheet :2);
throwing me...
received Java exception "java.lang.NoSuchMethodError:
org/apache/poi/xssf/usermodel/XSSFWorkbook.setTabColor(I)V"
So it found the class but got pissy about the method...
Bill
From: "Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 11/28/2016 01:34 PM
Subject: Re: Has anyone done TAB colors for HSSF POI?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
Yea, that is what I found. As long as you are using XSSF (.xlsx)
workbooks, that should work. It will not work for HSSF (.xls) workbooks.
public static void main(String[] args) throws Exception {
Workbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet("Sheet 1");
if (sheet instanceof XSSFSheet) {
((XSSFSheet)
sheet).setTabColor(IndexedColors.AQUA.index);
}
// Write the Document in file system
FileOutputStream out = new
FileOutputStream(new File(
"tabcolortest.xlsx"));
wb.write(out);
out.close();
wb.close();
System.out.println("tabcolortest.xlsx
written successully");
}
}
I think you will need a java stub to cast your sheet to an XSSFSheet, but,
you could just try defining it something like this in RPG:
// ----------------------------------------------------------------
// XSSFSheet_setTabColor()
//
// Sets the tab color of an XSSFSheet
//
// color - (input) Indexsed color Integer
// ----------------------------------------------------------------
dcl-pr XSSFSheet_setTabColor ExtProc(*JAVA
: XSSFSHEET_CLASS
: 'setTabColor');
type Like(jInt) value;
end-pr;
And just see if you can pass a Sheet object to it. I'm guessing no, but
since the object is really an XSSFSheet object (Sheet is an interface, not
a class), it might just work. But it definitely won't work if you are
trying to use an HSSFWorkbook.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----broehmer@xxxxxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: broehmer@xxxxxxxxxxxxxxx
Date: 11/28/2016 01:50PM
Subject: Re: Has anyone done TAB colors for HSSF POI?
Mark,
Method appears to be XSSFSheet.setTabColor
and then sheet.setTabColor(int colorIndex)
or sheet.setTabColor(num)
Bill
From: "Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 11/28/2016 12:45 PM
Subject: Has anyone done TAB colors for HSSF POI?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
I see in the java source a setTabColor for XSSF, but not one for HSSF.
Which package did you find that in?
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----broehmer@xxxxxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: broehmer@xxxxxxxxxxxxxxx
Date: 11/28/2016 01:33PM
Subject: Has anyone done TAB colors for HSSF POI?
Just seems so minor of a thing to make tab colors in POI. I see the
setTabColor in the POI documentation but I haven't come across anyone
changing the HSSF stuff that Scott did. Any thoughts/examples?
Bill
"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments
accompanying it) contain confidential information belonging to the sender.
The information is intended only for the use of the intended recipient.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution or the taking of any action in reliance
on the contents of the information is strictly prohibited. Any
unauthorized interception of this transmission is illegal under the law.
If you have received this transmission in error, please promptly notify
the sender by reply e-mail, and then destroy all copies of the
transmission."
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: Has anyone done TAB colors for HSSF POI?, (continued)
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.