|
I've even tried hardcoding the .xls file name and spreadsheet name and still get the same results... /free hssf_begin_object_group(100); monitor; book = hssf_open('/home/scessna/excel/May05DailyLaborHours2.xls'); monitor; spreadsheet = hssf_getSheet(book:'May 25'); if spreadsheet = *null; spreadsheet = HSSF_newSheet(book:'May 25'); endif; on-error; spreadsheet = HSSF_newSheet(book:'May 25'); endmon; on-error; book = new_HSSFWorkbook(); spreadsheet = HSSF_newSheet(book:'May 25'); endmon; HSSF_save(book:'/home/scessna/excel/May05DailyLaborHours2.xls'); hssf_end_object_group(); *inlr = *on; /end-free Shane Cessna iSeries Programmer iSeries WAS Administrator North American Lighting, Inc. (618) 662-4483 x2776 shane_cessna@xxxxxxx michael@xxxxxxxxxxxxxxxxxx Sent by: java400-l-bounces@xxxxxxxxxxxx 05/26/2005 08:43 AM Please respond to Java Programming on and around the iSeries / AS400 <java400-l@xxxxxxxxxxxx> To Java Programming on and around the iSeries / AS400 <java400-l@xxxxxxxxxxxx> cc Subject RE: Jakarta POI HSSF question... What's the actual error? What does %status show? See anything in the job log? > -------- Original Message -------- > Subject: RE: Jakarta POI HSSF question... > From: Shane_Cessna@xxxxxxx > Date: Thu, May 26, 2005 9:35 am > To: Java Programming on and around the iSeries / AS400 > <java400-l@xxxxxxxxxxxx> > > sorry guys, I tried that in the CL...still get the same results...if it > helps, here's my source...the hssf_h & HSSF binding direcotry is the stuff > that Scott Klement put in a few Club Tech newsletters for > iSeriesNetwork.com...http://www.iseriesnetwork.com/noderesources/code/clubtechcode/ExcelCrtDemo.zip > > JPTESTC2 - CLP > PGM > CHGCURDIR DIR('/') > ADDENVVAR ENVVAR(CLASSPATH) + > VALUE('.:QIBM/UserData/Java400/ext/poi-2.5.+ > 1-final-20040804.jar') REPLACE(*YES) > CALL PGM(JPTEST2) > ENDPGM > > JPTEST2 - RPGLE > h dftactgrp(*no) bnddir('HSSF') thread(*serialize) > h option(*srcstmt:*nodebugio:*noshowcpy) bnddir('QC2LE') > /copy qsysinc/qrpglesrc,jni > /copy qrpglesrc,hssf_h > //--------------------------------------------- > // Data Structures > //--------------------------------------------- > d ds > dmonthsshort 48a Inz('Jan + > d Feb + > d Mar + > d Apr + > d May + > d Jun + > d Jul + > d Aug + > d Sep + > d Oct + > d Nov + > d Dec ') > dmonthshort 4a dim(12) overlay(monthsshort) > d ds > d year4 1 4 0 > d year2a 2a overlay(year4:3) > //--------------------------------------------------------------- > // Standalones & Constants > //--------------------------------------------------------------- > d book s like(HSSFWorkbook) > d spreadsheet s like(HSSFSheet) > d enddate s d > d endday s 2p 0 > d dayname2 s 6a varying > d attachment s 50a > //------------------------------------------------------------ > // Mainline > //------------------------------------------------------------ > /free > enddate = %date() - %days(1); > endday = %subdt(enddate:*days); > year4 = %subdt(enddate:*years); > hssf_begin_object_group(100); > attachment = '/home/scessna/excel/' + > %trim(monthshort(%subdt(enddate:*months))) + > %trim(year2a) + 'DailyLaborHours2.xls'; > dayname2 = %trim(monthshort(%subdt(enddate:*months))) + ' ' + > %char(endday); > monitor; > book = hssf_open(%trim(attachment)); <-- this never gets found & > jumps to the on-error > monitor; > spreadsheet = hssf_getSheet(book:%trim(dayname2)); > if spreadsheet = *null; > spreadsheet = HSSF_newSheet(book:%trim(dayname2)); > endif; > on-error; > spreadsheet = HSSF_newSheet(book:%trim(dayname2)); > endmon; > on-error; > book = new_HSSFWorkbook(); <-- here is > where it jumps to... > spreadsheet = HSSF_newSheet(book:%trim(dayname2)); > endmon; > HSSF_save(book:%trim(attachment)); > hssf_end_object_group(); > *inlr = *on; > /end-free > > if you guys can find anything wrong with my code, please let me > know...thanks again... > > Shane > > > Hi, > > here is what I do in a CL before I call the RPGLE (with > Jakarta POI): > > CHGCURDIR DIR('/jakartapoi') > ADDENVVAR ENVVAR(CLASSPATH) + > VALUE('.:/jakartapoi:/jakartapoi/jakartapoi151.jar') + > REPLACE(*YES) > > Regards, > Magne > > > Date: Wed, 25 May 2005 10:55:39 -0500 > From: Shane_Cessna@xxxxxxx Add To Address Book > Subject: RE: Jakarta POI HSSF question... > To: Java Programming on and around the iSeries / AS400 > <java400-l@xxxxxxxxxxxx> > > > > Michael, > > Where can I find this CLASSPATH parameter?... > > Shane Cessna > iSeries Programmer > iSeries WAS Administrator > North American Lighting, Inc. > (618) 662-4483 x2776 > shane_cessna@xxxxxxx > -- > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) > mailing list > To post a message email: JAVA400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/java400-l > or email: JAVA400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l. > > > -- > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list > To post a message email: JAVA400-L@xxxxxxxxxxxx > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/mailman/listinfo/java400-l > or email: JAVA400-L-request@xxxxxxxxxxxx > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l.
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.