Skip to content

Conditional Formatting ‐ Custom Iconsets

OssianEPPlus edited this page Aug 21, 2023 · 14 revisions

As of Epplus 7.0 you can create CustomIconSets with EPPlus

To do so, try e.g.

 using (var pck = new ExcelPackage())
{
     var threeIcon = wks.ConditionalFormatting.AddThreeIconSet(new ExcelAddress("A1:A20"), eExcelconditionalFormatting3IconsSetType.Triangles);

     threeIcon.Icon1.CustomIcon = eExcelconditionalFormattingCustomIcon.RedFlag;
     threeIcon.Icon2.CustomIcon = eExcelconditionalFormattingCustomIcon.NoIcon;
     threeIcon.Icon3.CustomIcon = eExcelconditionalFormattingCustomIcon.GrayDownInclineArrow;
}

This is also available with FourIcon and FiveIcon sets. The OfficeOpenXml.ConditionalFormatting.eExcelconditionalFormattingCustomIcon enum includes an option for all icons available in Excel.

Results:

image

image

EPPlus wiki

Versions

Worksheet & Ranges

Styling

Import/Export data

Formulas and filters

Charts & Drawing objects

Tables & Pivot Tables

VBA & Protection

Clone this wiki locally