Bug 54647 - addConditionalFormatting fails for whole column ranges
Summary: addConditionalFormatting fails for whole column ranges
Status: NEW
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.9-FINAL
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2013-03-06 15:59 UTC by Didier Loiseau
Modified: 2014-08-25 13:57 UTC (History)
1 user (show)

Test code that demonstrates the bug (1.00 KB, text/x-java)
2013-03-06 15:59 UTC, Didier Loiseau

Note You need to log in before you can comment on or make changes to this 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