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



No, I'm using Java 6.

The Range should be defined as:

d range ... Like(CellRangeAddress);

But that may be a typo on your part since using RangeAddress vs. CellRangeAddress would likely cause it to fail compile.

If I am sure of my definitions, I usually look at my JVM and environment variables. If something gets hosed, you have to sign off, then sign back on since you only get a single JVM per job and once it is corrupted you need a new job to get a new JVM. I created a CL to start my JVM so I could manage it manually, but eventually once I got things stable, I just put it into my initial program. Here is my SETUPJVM CLP.

PGM
DCLPRCOPT DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR(JCS)
DCL VAR(&POINTER) TYPE(*PTR)
ADDENVVAR ENVVAR(CLASSPATH) +
VALUE('+
/java/poi-3.13/poi-3.13-20150929.jar:+
/java/poi-3.13/poi-ooxml-3.13-20150929.jar:+
/java/poi-3.13/poi-ooxml-schemas-3.13-20150929.jar:+
/java/poi-3.13/lib/commons-codec-1.9.jar:+
/java/poi-3.13/lib/commons-logging-1.1.3.jar:+
/java/poi-3.13/lib/log4j-1.2.17.jar:+
/java/poi-3.13/ooxml-lib/xmlbeans-2.6.0.jar:+
/java/poix/poi-extend-dev.jar:+
/java/xlparse36/xlparse.jar:+
/java/javamail/javax.mail.jar:+
/java/rpgmail/rpgmail.jar:+
/java/prod/lib/mxSqlSvrJdbc.jar:+
/java/prod/lib/sqljdbc.jar:+
/java/prod/classes/cribMaster+
') LEVEL(*JOB) REPLACE(*YES)
ADDENVVAR ENVVAR(QIBM_RPG_JAVA_PROPERTIES) +
VALUE('+
-Djava.awt.headless=true;+
-Dos400.awt.native=true;+
') REPLACE(*YES)
ADDENVVAR ENVVAR(JAVA_HOME) +
VALUE('/QOpenSys/QIBM/ProdData/JavaVM/jdk626/32bit'+
) REPLACE(*YES)
CALLPRC PRC(START_JVM) RTNVAL(&POINTER)
out: ENDPGM

Note that procdure call to START_JVM which resides in HSSFR4. Also there are some classes not found in POI since you only get one shot to declare your classpath, and if that is wrong when you start your JVM, you need to log off and log back on to get a new JVM. Unfortunately I have not found a way to discover your current classpath, because it might not be what is in the environment variable. Note, the environment variable can be changed, but the class path is based on the value of the environment variable (or maybe a command line option if you use runjava) at the time the jvm is started. But if you use this simple setupjvm clp, then you know what it is. Another advantage of a cl like this is you can call it in a batch stream to set up the JVM for that job, and you know it is correct. Note, this is my development clp, the production one uses POI 3.12.


Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----broehmer@xxxxxxxxxxxxxxx wrote: -----
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
From: broehmer@xxxxxxxxxxxxxxx
Date: 02/22/2016 10:49AM
Subject: Re: Update Excel with RPG


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.

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.