Return-Path: X-Original-To: apmail-poi-user-archive@www.apache.org Delivered-To: apmail-poi-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 75F9541E8 for ; Thu, 23 Jun 2011 10:52:25 +0000 (UTC) Received: (qmail 2307 invoked by uid 500); 23 Jun 2011 10:52:25 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 2270 invoked by uid 500); 23 Jun 2011 10:52:24 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 2259 invoked by uid 99); 23 Jun 2011 10:52:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 10:52:24 +0000 X-ASF-Spam-Status: No, hits=3.5 required=5.0 tests=FSL_RU_URL,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.210.46] (HELO mail-pz0-f46.google.com) (209.85.210.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Jun 2011 10:52:18 +0000 Received: by pzk9 with SMTP id 9so1462930pzk.33 for ; Thu, 23 Jun 2011 03:51:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.250.29 with SMTP id x29mr349503wfh.21.1308826316146; Thu, 23 Jun 2011 03:51:56 -0700 (PDT) Received: by 10.142.233.10 with HTTP; Thu, 23 Jun 2011 03:51:56 -0700 (PDT) In-Reply-To: References: <1308578123662-4506461.post@n5.nabble.com> <729840.20894.qm@web113615.mail.gq1.yahoo.com> <06F0705F2FE41247888B0AAF3FC9622207B3BF6E@fsmail3.ui.uillinois.edu> <98562.47419.qm@web113612.mail.gq1.yahoo.com> <06F0705F2FE41247888B0AAF3FC9622207B3BF91@fsmail3.ui.uillinois.edu> <821041.70106.qm@web113605.mail.gq1.yahoo.com> <06F0705F2FE41247888B0AAF3FC9622207B3BFA7@fsmail3.ui.uillinois.edu> Date: Thu, 23 Jun 2011 14:51:56 +0400 Message-ID: Subject: Re: Problem creating an .xlsx file using POI and XSSF From: Yegor Kozlov To: POI Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Fixed in r1138819 I fixed workbook.createSheetName(sheetName) to silently truncate the input argument if it is longer than 31 character. The idea to throw IllegalArgumentException is not very good. My concern is existing usages of POI in production. With version of POI prior to 3.8 exis= ting code swallowed long sheet names without any exceptions. If we decided to th= row IllegalArgumentException then these system would start to fail which is not good. Truncating the input argument to 31 character seems a reasonable workaround= . Yegor On Wed, Jun 22, 2011 at 4:04 PM, Yegor Kozlov wrote= : > 2007 works for me, but the behavior may depend on Excel update number > or service pack. > > OK, I'm convinced to revert my changes. The fix is coming soon. I > created a new Bugzilla ticket to track progress: > > https://issues.apache.org/bugzilla/show_bug.cgi?id=3D51415 > > Yegor > > On Wed, Jun 22, 2011 at 3:09 PM, snelligan wrote: >> Attached is a problem which shows the 31 character problem. >> >> >> >> We are running Excel 2007 and having the problem. >> >> >> >> -Steve Nelligan >> >> >> >> >> >> Steven M. Nelligan >> >> >> >> From: Yegor Kozlov-4 [via Apache POI] >> [mailto:ml-node+4513283-449273712-221743@n5.nabble.com] >> Sent: Wednesday, June 22, 2011 3:11 AM >> To: Nelligan, Steve M (Facilities & Services) >> Subject: Re: Problem creating an .xlsx file using POI and XSSF >> >> >> >> On Tue, Jun 21, 2011 at 9:50 PM, Jon Svede <[hidden email]> wrote: >>> The javdoc spells out that limitation but I agree with you, I think it >> should >>> throw an exception. >>> >> Not exactly, the rule is more complex. >> >> Non Excel clients such as OpenOffice allow opening / editing of >> worksheets with names longer than 31 characters. >> >> Some time back I loosened the 31 characters constraint to support >> that. That seemed to be OK for Excel 2003, Excel 2007 and OpenOffice. >> They all were able to open workbooks with long sheet names. Now I'm >> testing in Excel 2010 and it fails to open .xlsx. >> >> The test synopsis is below: >> >> XLS format: >> >> [OK] Excel 2003 can open .xls files =A0with long sheet names without >> error or warning. The sheet tab shows the full name. >> [OK] Excel 2007 can open .xls files =A0with long sheet names without >> error or warning. The sheet name is silently truncated to 31 >> characters. >> [OK] Excel 2010 can open .xls files =A0with long sheet names without >> error or warning. The sheet name is silently truncated to 31 >> characters. >> >> XLSX format: >> >> [OK] Excel 2007 can open .xls files =A0with long sheet names without >> error or warning. The sheet name is silently truncated to 31 >> characters. >> [FAILURE] Excel 2010 failes to open .xlsx files =A0with sheet names >> longer than 31 characters. >> >> I'm inclined to revert my previous change and always enforce the 31 >> characters rule. The question is what to do if the sheetName argument >> is long? Throw IllegalArgumentException or silently truncate to 31 >> chars? >> >> Yegor >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [hidden email] >> For additional commands, e-mail: [hidden email] >> >> >> >> >> ________________________________ >> >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://apache-poi.1045710.n5.nabble.com/Problem-creating-an-xlsx-file-us >> ing-POI-and-XSSF-tp4506461p4513283.html >> >> To unsubscribe from Problem creating an .xlsx file using POI and XSSF, >> click here >> > unsubscribe_by_code&node=3D4506461&code=3Dc25lbGxpZ2FAaWxsaW5vaXMuZWR1fD= Q1MD >> Y0NjF8MjYyNDY3NjE4> . >> >> >> >> -- >> View this message in context: http://apache-poi.1045710.n5.nabble.com/Pr= oblem-creating-an-xlsx-file-using-POI-and-XSSF-tp4506461p4513669.html >> Sent from the POI - User mailing list archive at Nabble.com. > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org