[]
Writes a JSON string that combines all JSON parts of the SpreadJS .sjs content for this workbook to the specified stream.
Use this method to export the workbook as a single SJS JSON payload through a Stream.
void ToSjsJson(Stream stream)
Sub ToSjsJson(stream As Stream)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The output stream that receives the generated SJS JSON content. Must not be null. |
worksheet.Range["A1:B2"].Value = new object[,] {
{ "Name", "Value" },
{ "Test", 100 }
};
using (MemoryStream stream = new MemoryStream())
{
workbook.ToSjsJson(stream);
string sjsJson = System.Text.Encoding.UTF8.GetString(stream.ToArray());
}
Integrates all JSON files in the SpreadJS .sjs format into a single string and writes it to the specified stream.
Use SjsSaveOptions to control how workbook content is included when generating the SJS JSON output.
void ToSjsJson(Stream stream, SjsSaveOptions options)
Sub ToSjsJson(stream As Stream, options As SjsSaveOptions)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The output stream that receives the integrated JSON string. |
| SjsSaveOptions | options | The save options used when generating the SpreadJS .sjs JSON output. |
worksheet.Range["A1:B2"].Value = new object[,] {
{ "Name", "Value" },
{ "Test", 100 }
};
SjsSaveOptions options = new SjsSaveOptions();
options.IncludeFormulas = true;
using (MemoryStream stream = new MemoryStream())
{
workbook.ToSjsJson(stream, options);
string sjsJson = System.Text.Encoding.UTF8.GetString(stream.ToArray());
}
Generates a single JSON payload that represents the workbook in SpreadJS .sjs format.
string ToSjsJson()
Function ToSjsJson() As String
| Type | Description |
|---|---|
| string | A JSON string that contains the workbook content in SpreadJS .sjs format. |
worksheet.Range["A1:B2"].Value = new object[,] {
{ "Name", "Value" },
{ "Test", 100 }
};
string sjsJson = workbook.ToSjsJson();
Generates a single JSON payload that represents the workbook in SpreadJS .sjs format, using the specified save options.
string ToSjsJson(SjsSaveOptions options)
Function ToSjsJson(options As SjsSaveOptions) As String
| Type | Name | Description |
|---|---|---|
| SjsSaveOptions | options | The save options used to generate the SJS JSON content. |
| Type | Description |
|---|---|
| string | A JSON string that contains the workbook content in SpreadJS .sjs format. |
worksheet.Range["A1:B2"].Value = new object[,] {
{ "Name", "Value" },
{ "Test", 100 }
};
SjsSaveOptions options = new SjsSaveOptions();
options.IncludeEmptyRegionCells = false;
string sjsJson = workbook.ToSjsJson(options);