Skip to content

Commit 835ff6b

Browse files
committed
890332: Added content for the open and save Json feature in Spreadsheet.
1 parent 4163979 commit 835ff6b

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

ej2-asp-core-mvc/spreadsheet/open-save.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,30 @@ You can open excel file into a read-only mode by using the [`openComplete`](http
140140
{% endtabs %}
141141
{% endif %}
142142

143+
### Configure JSON deserialization options
144+
145+
Previously, when opening a workbook JSON object into the Spreadsheet using the `openFromJson` method, the entire workbook, including all features specified in the JSON object, was processed and loaded into the Spreadsheet.
146+
147+
Now, you have the option to selectively ignore some features during the opening of the JSON object by configuring deserialization options and passing them as arguments to the `openFromJson` method. This argument is optional, and if not configured, the entire workbook JSON object will be loaded without ignoring any features.
148+
149+
```ts
150+
spreadsheet.openFromJson({ file: file }, { ignoreStyle: true });
151+
```
152+
153+
| Options | Description |
154+
| ----- | ----- |
155+
| onlyValues | If **true**, only the cell values will be loaded. |
156+
| ignoreStyle | If **true**, styles will be excluded when loading the JSON data. |
157+
| ignoreFormula | If **true**, formulas will be excluded when loading the JSON data. |
158+
| ignoreFormat | If **true**, number formats will be excluded when loading the JSON data. |
159+
| ignoreConditionalFormat | If **true**, conditional formatting will be excluded when loading the JSON data. |
160+
| ignoreValidation | If **true**, data validation rules will be excluded when loading the JSON data. |
161+
| ignoreFreezePane | If **true**, freeze panes will be excluded when loading the JSON data. |
162+
| ignoreWrap | If **true**, text wrapping settings will be excluded when loading the JSON data. |
163+
| ignoreChart | If **true**, charts will be excluded when loading the JSON data. |
164+
| ignoreImage | If **true**, images will be excluded when loading the JSON data. |
165+
| ignoreNote | If **true**, notes will be excluded when loading the JSON data. |
166+
143167
### External workbook confirmation dialog
144168

145169
When you open an excel file that contains external workbook references, you will see a confirmation dialog. This dialog allows you to either continue with the file opening or cancel the operation. This confirmation dialog will appear only if you set the `AllowExternalWorkbook` property value to **false** during the open request, as shown below. This prevents the spreadsheet from displaying inconsistent data.
@@ -156,7 +180,7 @@ public IActionResult Open(IFormCollection openRequest)
156180

157181
> This feature is only applicable when importing an Excel file and not when loading JSON data or binding cell data.
158182
159-
![External workbook confirmation dialog](./images/external-reference-dialog-alert%20.png)
183+
![External workbook confirmation dialog](./images/external-reference-dialog-alert.png)
160184

161185
## Supported file formats
162186

@@ -305,6 +329,30 @@ The possible values are:
305329
{% endtabs %}
306330
{% endif %}
307331

332+
### Configure JSON serialization options
333+
334+
Previously, when saving the Spreadsheet as a workbook JSON object using the `saveAsJson` method, the entire workbook with all loaded features were processed and saved as a JSON object.
335+
336+
Now, you have the option to selectively ignore some features while saving the Spreadsheet as a JSON object by configuring serialization options and passing them as arguments to the `saveAsJson` method. This argument is optional, and if not configured, the entire workbook JSON object will be saved without ignoring any features.
337+
338+
```ts
339+
spreadsheet.saveAsJson({ onlyValues: true });
340+
```
341+
342+
| Options | Description |
343+
| ----- | ----- |
344+
| onlyValues | If **true**, includes only the cell values in the JSON output. |
345+
| ignoreStyle | If **true**, excludes styles from the JSON output. |
346+
| ignoreFormula | If **true**, excludes formulas from the JSON output. |
347+
| ignoreFormat | If **true**, excludes number formats from the JSON output. |
348+
| ignoreConditionalFormat | If **true**, excludes conditional formatting from the JSON output. |
349+
| ignoreValidation | If **true**, excludes data validation rules from the JSON output. |
350+
| ignoreFreezePane | If **true**, excludes freeze panes from the JSON output. |
351+
| ignoreWrap | If **true**, excludes text wrapping settings from the JSON output. |
352+
| ignoreChart | If **true**, excludes charts from the JSON output. |
353+
| ignoreImage | If **true**, excludes images from the JSON output. |
354+
| ignoreNote | If **true**, excludes notes from the JSON output. |
355+
308356
### Supported file formats
309357

310358
The following list of Excel file formats are supported in Spreadsheet:

0 commit comments

Comments
 (0)