Skale
asked on
Conditional formatting issue in ClosedXML
In my tool i have code like below to conditional formatting the cells as icons
if they are greater than 0 they will get green check icon, if cell value = 0 they will turn to yellow exclamation symbol and if they are below zero they should represent with red cancel icon.
But the problem is it doesnt effect the greaterthen value so my conditional formatting not works properly.
Any help would be grateful.
Thanks.
if they are greater than 0 they will get green check icon, if cell value = 0 they will turn to yellow exclamation symbol and if they are below zero they should represent with red cancel icon.
But the problem is it doesnt effect the greaterthen value so my conditional formatting not works properly.
Any help would be grateful.
Thanks.
private void ConditionalFormatStatus(IXLWorksheet worksheet)
{
IXLCell first_cell = worksheet.Cell(2, 6);
IXLCell last_cell = worksheet.Cell(worksheet.LastRowUsed().RowNumber(), 6);
IXLRange range = worksheet.Range(first_cell.Address, last_cell.Address);
range.AddConditionalFormat().IconSet(XLIconSetStyle.ThreeSymbols, false, true)
.AddValue(XLCFIconSetOperator.EqualOrGreaterThan, 0, XLCFContentType.Number)
.AddValue(XLCFIconSetOperator.GreaterThan, 0, XLCFContentType.Number);
//.AddValue(XLCFIconSetOperator., 3, XLCFContentType.Number);
}
The problem is that you have conditions overlap. EqualOrGreaterThan should be replaced with Equal if available.
ASKER
Hi Eduard,
There's no Equal property :(
There's no Equal property :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I added for all of them EqualorGreaterThan and it works. And as you said i added additional one.