Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 47885 invoked from network); 21 Jan 2004 12:25:59 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 21 Jan 2004 12:25:59 -0000 Received: (qmail 22380 invoked by uid 500); 21 Jan 2004 12:25:55 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 22362 invoked by uid 500); 21 Jan 2004 12:25:54 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 22349 invoked from network); 21 Jan 2004 12:25:54 -0000 Received: from unknown (HELO ext-ch1gw-2.online-age.net) (216.34.191.36) by daedalus.apache.org with SMTP; 21 Jan 2004 12:25:54 -0000 Received: from int-ch1gw-1.online-age.net (int-ch1gw-1 [3.159.232.65]) by ext-ch1gw-2.online-age.net (8.12.9/8.12.9/990426-RLH) with ESMTP id i0LCPqCw004874 for ; Wed, 21 Jan 2004 07:25:52 -0500 (EST) Received: from cinmlef02.e2k.ad.ge.com (localhost [127.0.0.1]) by int-ch1gw-1.online-age.net (8.12.9/8.12.3/990426-RLH) with ESMTP id i0LCPpH0016058 for ; Wed, 21 Jan 2004 07:25:51 -0500 (EST) Received: from HYDMLVEM01.e2k.ad.ge.com ([3.159.192.30]) by cinmlef02.e2k.ad.ge.com with Microsoft SMTPSVC(5.0.2195.6713); Wed, 21 Jan 2004 07:25:51 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.0.6521.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Exception =java.lang.ArrayIndexOutOfBoundsException: 112 Date: Wed, 21 Jan 2004 17:55:46 +0530 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Exception = 112 Thread-Index: AcPgGCZrsU6HI/ooQZm56PwQ0EqELTYGIVmQ From: "Kommineni, Sateesh \(GE Consumer & Industrial\)" To: "POI Users List" X-OriginalArrivalTime: 21 Jan 2004 12:25:51.0016 (UTC) FILETIME=[B4E42280:01C3E019] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I am getting the following Exception.. java.lang.ArrayIndexOutOfBoundsException: 112=20 In my earlier mail i mentioned just 112 , which i got by printing the = getMessage() on exception. Sorry for just mentioning 112 Why i am getting ArrayIndexOutofBoundsException when i am trying to = write the data to a ServletOutputStream object.. Shall i need to specify the byte size i am going to write to the = stream?? Pls let me know your thoughts.. -Sateesh -----Original Message----- From: Avik Sengupta [mailto:avik.sengupta@itellix.com] Sent: Wednesday, January 21, 2004 5:37 PM To: POI Users List Subject: Re: Exception =3D 112 > What does the 112 mean ??=20 You tell me. You are eating up the exception.=20 On Wed, 2004-01-21 at 16:53, Kommineni, Sateesh (GE Consumer & Industrial) wrote: > Hi All,=09 >=20 > I am trying to modify an existing Excel File using the POI. >=20 > The Environment details are=20 >=20 > WSAD5.0 , POI =3D jakarta-poi-1.5.0-dev-20020415 >=20 > When i try to generate a File using the below given code...i am = getting the Error: > .... > [4/21/03 16:30:59:364 GMT+05:30] 26adc544 SystemOut O Created a = Row .. > [4/21/03 16:30:59:364 GMT+05:30] 26adc544 SystemOut O About to = write the=20 > [4/21/03 16:30:59:414 GMT+05:30] 26adc544 SystemOut O Excpe in = generateWorkBook()=3D112 >=20 > What does the 112 mean ??=20 >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > public void generateWorkBook(OutputStream out, ArrayList = ctqDetails)throws Exception{ > =09 > System.out.println(" Here in generateWorkBook() and out=3D"+out); =09 > GEISQMSCtqBeanEx ctqBeanEx =3D null; > HSSFWorkbook wb =3D null; > HSSFRow row =3D null; > HSSFCell cell =3D null; > FileOutputStream fout=3D null; > POIFSFileSystem fs =3Dnull; > String oldPartNum =3D""; > try{ > if(path=3D=3Dnull) > throw new Exception("Path is Not set Error.."); > fs =3D new POIFSFileSystem(new FileInputStream(path+FILE_NAME)); > wb =3D new HSSFWorkbook(fs); > HSSFSheet sheet =3D wb.getSheet("Ctq Details"); > System.out.println("No.of Sheets After=3D"+wb.getNumberOfSheets()); > int noOfCtqs =3D ctqDetails.size(); > System.out.println("No.Of CTQs=3D"+noOfCtqs); > for(int i=3D0;i ctqBeanEx =3D (CtqBeanEx) ctqDetails.get(i); > System.out.println("Part Number"+(i+1)+" = =3D"+ctqBeanEx.getPartNumber()+" Ctq = Number=3D"+ctqBeanEx.getCtqNumber()); > =09 > if(oldPartNum=3D=3Dnull) > oldPartNum =3D ctqBeanEx.getPartNumber(); > row =3D sheet.createRow((short)i);=09 > System.out.println("Old Part=3D"+oldPartNum); > if(oldPartNum!=3Dnull && = !oldPartNum.equals(ctqBeanEx.getPartNumber())){ > // Column 0 is Part Number =09 > cell =3D row.createCell((short)0); > cell.setCellValue(ctqBeanEx.getPartNumber()); > cell.setCellType(HSSFCell.CELL_TYPE_STRING); > =09 > } > // Column 1 is CTQ Number > cell =3D row.createCell((short)1); > cell.setCellValue(Integer.parseInt(ctqBeanEx.getCtqNumber())); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > // Column 2 is SubGroup Size > cell =3D row.createCell((short)2); > cell.setCellValue(ctqBeanEx.getSubGroupSize()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > // Column 3 is Ctq Specification > cell =3D row.createCell((short)3); > cell.setCellValue(ctqBeanEx.getCtqSpec()); > cell.setCellType(HSSFCell.CELL_TYPE_STRING); > =09 > // Column 4 is Unit Of Measure > cell =3D row.createCell((short)4); > cell.setCellValue(ctqBeanEx.getUom()); > cell.setCellType(HSSFCell.CELL_TYPE_STRING); > =09 > =09 > =09 > // Column 5 is USL > cell =3D row.createCell((short)5); > cell.setCellValue(ctqBeanEx.getUsl()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > // Column 6 is LSL > cell =3D row.createCell((short)6); > cell.setCellValue(ctqBeanEx.getLsl()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > // Column 7 is Nominal > cell =3D row.createCell((short)7); > cell.setCellValue(ctqBeanEx.getNominal()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > // Column 8 is UAL > /* > cell =3D row.createCell((short)8); > cell.setCellValue(ctqBeanEx.getUal()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > =09 > =09 > =09 > // Column 9 is LAL > cell =3D row.createCell((short)9); > cell.setCellValue(ctqBeanEx.getLal()); > cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC); > */ =09 > System.out.println("Created a Row .."); > oldPartNum =3D ctqBeanEx.getPartNumber(); > =09 > } > System.out.println("About to write the "); > int index =3D FILE_NAME.indexOf('.'); > fout=3Dnew = FileOutputStream(path+FILE_NAME.substring(0,index)+"1.xls"); > wb.write(fout); > System.out.println("Done with fout"); > if(out!=3Dnull){ > System.out.println("About to write the data to the Servlet = OutputStream"); > wb.write(out); > } >=20 > System.out.println("After constructing the Excel Sheet"); > } > catch(Exception e){ > System.out.println("Excpe in = generateWorkBook()=3D"+e.getMessage()); > throw e; > } > finally{ > try{ > fout.close(); =20 > } > catch(Exception e){ > throw new Exception("Unable to close the = FileOutputStream=3D"+e.getMessage()); > } > } >=20 > } >=20 > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Thanks in Advance.. > Sateesh >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: poi-user-help@jakarta.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: poi-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: poi-user-help@jakarta.apache.org