Bug 51415 - Sheet name cannot exceed 31 characters
Summary: Sheet name cannot exceed 31 characters
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.8-dev
Hardware: All All
: P2 regression (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2011-06-22 12:03 UTC by Yegor Kozlov
Modified: 2011-06-23 10:49 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Yegor Kozlov 2011-06-22 12:03:21 UTC
Excel 2007/2010 can't open .xlsx files with sheet names longer than 31 characters. 
It looks like a regression introduced in r993246, see Bug 49887

See discussion on poi-user: http://markmail.org/message/lxscumtoiq2hrjdz

Comment 1 Jon Svede 2011-06-22 14:25:27 UTC
I can take a look at this if you haven't already made the changes.

Comment 2 Yegor Kozlov 2011-06-23 10:49:38 UTC
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 existing code swallowed long sheet names without any exceptions. If we decided to throw IllegalArgumentException then these system would start to fail which is not good.

Truncating the input argumnet to 31 character seems a reasonable workaround.