[]
Generates a JSON string from the conditional format.
The returned string represents the current color scale conditional formatting rule and can be used with FromJson(string) to recreate the rule.
string ToJson()
Function ToJson() As String
| Type | Description |
|---|---|
| string | The conditional format JSON string. |
IRange range = worksheet.Range["A1:A5"];
range.Value = new object[,] {{10}, {30}, {50}, {70}, {90}};
IColorScale colorScale = range.FormatConditions.AddColorScale(ColorScaleType.TwoColorScale);
string json = colorScale.ToJson();