poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bin su <subin_1...@163.com>
Subject POI HSSFSheetConditionalFormatting can't read font color of the specified cell
Date Wed, 23 Nov 2011 02:19:33 GMT
It's not a bug but a problem. I use the code below to get the font color of the
specified cell,then i get right color.

<code>
		HSSFSheet sheet = (HSSFSheet) wb.getSheet(sheetName);
		CellReference cellReference = new CellReference(cellAddress); 
		
		
		Row row = (Row) sheet.getRow(cellReference.getRow());
		HSSFCell cell = (HSSFCell) row.getCell(cellReference.getCol());
	
		
		HSSFCellStyle eStyle = cell.getCellStyle();
		Font font = wb.getFontAt(eStyle.getFontIndex());
		int colorIndex = font.getColor();

		
		System.out.println("color´╝Ü"+colorIndex);
</code>


but if the cell is formated with HSSFSheetConditionalFormatting and
HSSFConditionalFormattingRule,then condition rule like  ">=1000",the cell font
color is red, but when i get the font color of the cell, the console print:
color:32767,i get a black color, how can i get the right color under the
HSSFConditionalFormattingRule.

my english is not well,i don't know weather you get my words.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message