[]
Generates a JSON string from the worksheet.
Serializes the current worksheet to JSON and applies the specified
SerializationOptions during serialization. If
serializationOptions is null, the worksheet is serialized
with internally created default options.
string ToJson(SerializationOptions serializationOptions = null)
Function ToJson(Optional serializationOptions As SerializationOptions = Nothing) As String
| Type | Name | Description |
|---|---|---|
| SerializationOptions | serializationOptions | The SerializationOptions object to apply during serialization; may be |
| Type | Description |
|---|---|
| string | The JSON string that represents the worksheet. |
worksheet.Range["A1:B2"].Value = new object[,] {
{"Name", "Value"},
{"Test", 100}
};
SerializationOptions options = new SerializationOptions();
options.IgnoreStyle = true;
string json = worksheet.ToJson(options);
Generates a JSON stream from a worksheet.
void ToJson(Stream stream, SerializationOptions serializationOptions = null)
Sub ToJson(stream As Stream, Optional serializationOptions As SerializationOptions = Nothing)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The specified JSON stream. |
| SerializationOptions | serializationOptions | the SerializationOptions object. |
worksheet.Range["A1"].Value = "Sample";
MemoryStream stream = new MemoryStream();
worksheet.ToJson(stream);