Hi,

On Thu, Mar 31, 2011 at 11:32 AM, Yegor Kozlov <[email protected]> wrote:
> POI's formula evaluator can only evaluate cells. Neither HSSF nor XSSF can
> determine if a cell meets its conditional formatting criteria. It would
> involve evaluation of the format formula which is not yet supported. A
> usermodel API for conditional formatting in XSSF is a planned improvement.
..
>
> The formula to evaluate is "cell.getNumericCellValue() > 0.5"
>
> Perhaps, the easiest way to evaluate it is to create a dummy formula cell
> somewhere not in the client area:

Yes, I was afraid of that, but it's probably the easiest way to avoid
duplicating a whole bunch of code.

>
> Note the dxfId="1" attribute of the cfRule bean. It is a format index in the
> style table and you should be able to get the font information as follows:
>
>  CellStyle style = workbook.getCellStyle(dxfId);
>

I was digging more and found the dxfId, but I wasn't sure how to get
to the style. Are you sure about the workbook.getCellStyle() ? I don't
seem to get the right style this way.

The long way seems to work:

CTDxf dxf = 
sheet.getWorkbook().getStylesSource().getCTStylesheet().getDxfs().getDxfArray((int)
rule.getDxfId());

but it's a bit of a detour...

Thanks for you help,
- Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to