Bug 54647

Summary: addConditionalFormatting fails for whole column ranges
Product: POI Reporter: Didier Loiseau <didierloiseau+apache>
Component: HSSFAssignee: POI Developers List <dev>
Status: NEW ---    
Severity: normal CC: ephi79
Priority: P2    
Version: 3.9-FINAL   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Test code that demonstrates the bug

Description Didier Loiseau 2013-03-06 15:59:26 UTC
Created attachment 30024 [details]
Test code that demonstrates the bug

Although CellRangeAddress supports whole column ranges like A:A and Excel supports it for conditional formatting, POI throws the following exception in case you try to do it (e.g. using CellRangeAddress.valueOf("A:A"))

Exception in thread "main" java.lang.IllegalArgumentException: Minumum row number is 0
	at org.apache.poi.ss.util.CellRangeAddressBase.validateRow(CellRangeAddressBase.java:63)
	at org.apache.poi.ss.util.CellRangeAddressBase.validate(CellRangeAddressBase.java:51)
	at org.apache.poi.hssf.usermodel.HSSFSheetConditionalFormatting.addConditionalFormatting(HSSFSheetConditionalFormatting.java:139)
	at org.apache.poi.hssf.usermodel.HSSFSheetConditionalFormatting.addConditionalFormatting(HSSFSheetConditionalFormatting.java:172)
	at org.apache.poi.hssf.usermodel.HSSFSheetConditionalFormatting.addConditionalFormatting(HSSFSheetConditionalFormatting.java:182)
	at TestConditionnalFormatWholeColumn.main(TestConditionnalFormatWholeColumn.java:18)

(the same test is also done for XSSF so I suppose it is also affected)
Comment 1 Ephi 2014-08-25 13:57:06 UTC
Encountered same bug with XSSF