Hi,
I would like to apply ‘Color Scale’ conditional formatting to a range and am having some problems. I begin by placing a datatable of data into the sheet like this:
Worksheet sheet = book.Worksheets[sheetIndex];
sheet.Name = sheetName;
// Place data
sheet.Cells.ImportDataTable(inputData, true, dataStartRow - 1, dataStartCol, inputData.Rows.Count,
inputData.Columns.Count, false, “dd/mm/yyyy”);
Now, I use an example snippet from here (http://www.aspose.com/docs/display/cellsnet/conditional+formatting) to apply the color scale:
// Add colour scale to highlight outliers
FormatConditionCollection conds = GetFormatCondition(“A9:C10”, Color.White);
int idx = conds.AddCondition(FormatConditionType.ColorScale);
FormatCondition cond = conds[idx];
cond.ColorScale.MidCfvo = null;
cond.ColorScale.MinColor = Color.Gold;
cond.ColorScale.MaxColor = Color.SkyBlue;
However it says ‘The name ‘GetFormatCondition’ does not exist in the current context.’ I’ve downloaded and referenced the latest build of the Aspose.Cells DLL zip file and it does not help. The closes I can see is in the ‘Cell’ object, a method called GetFormatConditions. Also the cond.ColorScale.MidCfvo is not recognised.
My desire is as follows:
a) Identify the range the ImportDatatable method used to place its data
b) Exclude the top row (headers), leftmost and rightmost columns, then apply ‘color scale’ conditional formatting to the remaining range.
I’d appreciate your help.
Thanks - Mark