[]
Generates a JSON string from this slicer.
Use this method to serialize the current slicer settings so that they can be applied later by using FromJson(string).
string ToJson()
Function ToJson() As String
| Type | Description |
|---|---|
| string | A JSON string that contains the current slicer settings. |
worksheet.Range["A1:B4"].Value = new object[,] {
{"Name", "Value"},
{"A", 100},
{"B", 200},
{"C", 300}
};
ITable table = worksheet.Tables.Add(worksheet.Range["A1:B4"], true);
ISlicerCache cache = workbook.SlicerCaches.Add(table, "Name");
ISlicer slicer = cache.Slicers.Add(worksheet, "Slicer1", "Name", 20, 20, 120, 180);
string json = slicer.ToJson();