Yes to all three, in fact, my example creates a new worksheet (I just didn't get to the save part). POI needs help with the second and third items though since it just reads and writes to the IFS. I use RPGMail for emailing, you can easily attach the spreadsheet, or send an HTML email with a link to the spreadsheet. I have built some procedures around RPGMail that are specific to our implementation, but you should be able to do that easily. I also incorporate CGIDEV2 to provide a template engine for my HTML emails.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----"Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx> wrote: -----
To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx>
From: "Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx>
Date: 12/21/2015 10:30AM
Subject: RE: Update Excel with RPG


1) Can this also be done as a new Excel.
2) Secondly, can this Excel be auto mailed as an attachment.
3) Or, can a link be included in the body of an email pointing to the Excel.

Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark Murphy/STAR BASE Consulting Inc.
Sent: Monday, December 21, 2015 10:22 AM
To: Midrange Systems Technical Discussion
Subject: Re: 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


-----"giovanni.arturi@xxxxxxxxx" <giovanni.arturi@xxxxxxxxx> wrote: -----
To: midrange-l@xxxxxxxxxxxx
From: "giovanni.arturi@xxxxxxxxx" <giovanni.arturi@xxxxxxxxx>
Date: 12/21/2015 06:30AM
Subject: Update Excel with RPG



Normal
0


14


false
false
false

IT
X-NONE
X-NONE











MicrosoftInternetExplorer4



























































































































































/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabella normale";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman","serif";}



Hi all



In a IFS Folder i have stored a Xls file; i would need to know if is it
possible (with RPG/HSSF) , update the xls file in such way to set the automatic
filter for all colunms



Thanks in advance



Keep in mind that i don't have any experience in HSSF , so if possible to do
how i have requested , i would be grateful if some one could suggest me some
example


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 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].