Other API Samples

Live SpreadsheetGear API Samples

Snippets Conditional Format (Icon Set)

A sample that applies an Icon Set conditional format to a range.

IWorkbook workbook = Factory.GetWorkbook();
IWorksheet worksheet = workbook.ActiveWorksheet;
IRange range = worksheet.Cells["A1:F10"];
range.Formula = "=RAND()";
IFormatConditions conditions = range.FormatConditions;
IFormatCondition condition = conditions.AddIconSetCondition();
IIconSetCondition iconSet = condition.IconSetCondition;
iconSet.IconSet = workbook.IconSets[SpreadsheetGear.IconSet.ThreeArrows];
Run This Sample
Render Image

Generate an image representation of the results of this sample, which uses the SpreadsheetGear.Drawing.Image class to convert ranges, charts and shapes to images.


Download File

Download an Excel Open XML Workbook (*.xlsx) file with the results of this sample.