[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ISlicer.ToJson

ToJson Method

ToJson()

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).

Declaration
string ToJson()
Function ToJson() As String
Returns
Type Description
string

A JSON string that contains the current slicer settings.

Examples
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();