This project has moved. For the latest updates, please go here.

Conditional Formatting

Sep 28, 2010 at 10:10 AM

Is it possible to do conditional formatting in EPPlus?

I can't do this at runtime, since the user needs to update certain columns, which will then need to be highlighted based on certain conditions

thanks

Coordinator
Sep 28, 2010 at 6:58 PM

No, there is no support for conditional formating in the library.

If you need it, use a template and update the WorksheetXML yourself. (You can check the format by renaming your template.xlsx *.zip and extract it.) 

The ordinary numberformat property supports a simple way of conditional format changing colors depending on Positive, negative and zero values.

Something like this,,,

ws.Cells["A1].Style.NumberFormat.Format="[Blue]#,##0.00;[Red]\-#,##0.00;[Black]#,##0.00";

... but if that's not what you want you have to use the WorksheetXml

Jan