Bug 51415

Summary: Sheet name cannot exceed 31 characters
Product: POI Reporter: Yegor Kozlov <yegor>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: regression    
Priority: P2    
Version: 3.8-dev   
Target Milestone: ---   
Hardware: All   
OS: All   

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

Yegor
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.

Jon
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. 

Yegor