Mark,
I'm back on my setAutoFilter problem.
After playing with different versions
including 3.7,3.11,3.12 I still have a problem
with the setAutoFilter showing up as an
invalid method. I got past the class not being
defined but now the error is:
"received Java exception "java.lang.NoSuchMethodError:
org/apache/poi/ss/usermodel/Sheet.setAutoFilter(Lorg/apache/poi/ss/util"
when calling method "setAutoFilter" with signature
"(Lorg.apache.poi.ss.util.CellRangeAddress;)V" in class
"org.apache.poi.ss.usermodel.Sheet".
The range is defined as D range ... like(RangeAddress)
The code is:
range = new_cellRangeAddress(0:100:0:4);
ssSheet_setAutoFilter(sheet:range);
hssf_h has been changed to include the setautofilter:
D SSSheet_setAutoFilter...
D PR EXTPROC(*JAVA: SHEET_CLASS
D :'setAutoFilter')
D ref like(CellRangeAddress) const
In your example you indicate that you are on 7.1.
So my question is a simple one: Do you think this would
have anything to do with my being on version 6.1 with java 6.0
instead of java 7?
Any help would be most appreciated.
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."
From: "Mark Murphy/STAR BASE Consulting Inc." <mmurphy@xxxxxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Date: 02/18/2016 07:49 AM
Subject: Re: Update Excel with RPG
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
First, you are correct about the call to new_cellRangeAddress(0,10,0,5);
should use : instead of , to separate parameters.
Second, to enable this, you only need to modify hssf_h.
Third, what is the error message, I am unsure what your problem is. Is
setAutoFilter not found in org.apache.poi.ss.usermodel.Sheet?
Do you have range declared as a Java Object?
dcl-s range Like(CellRangeAddress);
What does you code look like?
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----broehmer@xxxxxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: broehmer@xxxxxxxxxxxxxxx
Date: 02/17/2016 03:33PM
Subject: Update Excel with RPG
POI does it starting with version 3.7, here is a Java example:
Workbook wb = new HSSFWorkbook(); //or new XSSFWorkbook();
Sheet sheet = wb.createSheet();
sheet.setAutoFilter(new CellRangeAddress(0,100,0,10));
Now, Scott's HSSF prototypes do not include the setAutoFilter method,
but that can be added
// ----------------------------------------------------------------
// ssSheet_setAutoFilter()
//
// sets an auto filter for a range of cells
// ref - a range to set the filter on
// ----------------------------------------------------------------
dcl-pr ssSheet_setAutoFilter
ExtProc(*JAVA
: SHEET_CLASS
: 'setAutoFilter');
ref Like(CellRangeAddress) const;
end-pr;
Call in RPG using HSSF this way to set auto filter on the first ten rows
and first five columns:
wb = new_XSSFWorkbook();
sheet = ss_newSheet(wb: 'Sheet1');
range = new_cellRangeAddress(0,10,0,5);
ssSheet_setAutoFilter(sheet: range);
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
Back in December Mark Murphy injected the above as a modification to
Scott's HSSF_h.
I'm wondering if Mark would elaborate on what he did.
I tried to add this addition to HSSF_h (using POI-3.11) and I'm not sure
what I'm missing
as far as modifications go because while compiling a program it says the
setAutoFilter
is not defined.
Also, I'm concerned that what's shown ...Address(0,10,0,5) probably
should be (0:10:0:5)
at least in the rpg code. Should there be entries in HSSF_h as well as
HSSF4?
D SSSheet_setAutoFilter...
D PR EXTPROC(*JAVA: SHEET_CLASS
D :'setAutoFilter')
D ref like(CellRangeAddress) const
Thanks!
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."
"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.