[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Workbook.FromSjsJson

FromSjsJson Method

FromSjsJson(string)

Generates a workbook from a JSON string containing the contents of .sjs file format.

Declaration
public void FromSjsJson(string json)
Public Sub FromSjsJson(json As String)
Parameters
Type Name Description
string json

The JSON string.

Implements
Examples
worksheet.Range["A1:B2"].Value = new object[,] {
    { "Name", "Value" },
    { "Test", 100 }
};
string json = workbook.ToSjsJson();
IWorkbook importedWorkbook = new Workbook();
importedWorkbook.FromSjsJson(json);

FromSjsJson(string, SjsOpenOptions)

Generates a workbook from a JSON string containing the contents of .sjs file format.

Declaration
public void FromSjsJson(string json, SjsOpenOptions openOptions)
Public Sub FromSjsJson(json As String, openOptions As SjsOpenOptions)
Parameters
Type Name Description
string json

The JSON string.

SjsOpenOptions openOptions

The open options for opening SpreadJS .sjs file.

Implements
Examples
worksheet.Range["A1:B2"].Value = new object[,] {
    { "Name", "Value" },
    { "Test", 100 }
};
string json = workbook.ToSjsJson();
SjsOpenOptions openOptions = new SjsOpenOptions();
IWorkbook importedWorkbook = new Workbook();
importedWorkbook.FromSjsJson(json, openOptions);

FromSjsJson(Stream)

Generates a workbook from a JSON stream containing the contents of .sjs file format.

Declaration
public void FromSjsJson(Stream stream)
Public Sub FromSjsJson(stream As Stream)
Parameters
Type Name Description
Stream stream

The JSON stream.

Implements
Examples
worksheet.Range["A1:B2"].Value = new object[,] {
    { "Name", "Value" },
    { "Test", 100 }
};
string json = workbook.ToSjsJson();
IWorkbook importedWorkbook = new Workbook();
using (MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(json)))
{
    importedWorkbook.FromSjsJson(stream);
}

FromSjsJson(Stream, SjsOpenOptions)

Generates a workbook from a JSON stream containing the contents of .sjs file format.

Declaration
public void FromSjsJson(Stream stream, SjsOpenOptions openOptions)
Public Sub FromSjsJson(stream As Stream, openOptions As SjsOpenOptions)
Parameters
Type Name Description
Stream stream

The JSON stream.

SjsOpenOptions openOptions

The open options for opening SpreadJS .sjs file.

Implements
Examples
worksheet.Range["A1:B2"].Value = new object[,] {
    { "Name", "Value" },
    { "Test", 100 }
};
string json = workbook.ToSjsJson();
SjsOpenOptions openOptions = new SjsOpenOptions();
IWorkbook importedWorkbook = new Workbook();
using (MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(json)))
{
    importedWorkbook.FromSjsJson(stream, openOptions);
}