You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ej2-asp-core-mvc/spreadsheet/open-save.md
+60-30Lines changed: 60 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -218,6 +218,35 @@ The following code snippet demonstrates how to configure the deserialization opt
218
218
{% endtabs %}
219
219
{% endif %}
220
220
221
+
### To Open Spreadsheet data as a Base64 string
222
+
223
+
In the Syncfusion Spreadsheet component, there is no direct option to open data as a `Base64` string. To achieve this, the `import()` function fetches the `Base64` string, converts it to a Blob, creates a File object from the Blob, and then opens it using the `open` method in the spreadsheet.
224
+
225
+
The following code example shows how to open the spreadsheet data as base64 string.
226
+
227
+
{% if page.publishingplatform == "aspnet-core" %}
228
+
229
+
{% tabs %}
230
+
{% highlight cshtml tabtitle="CSHTML" %}
231
+
{% include code-snippet/spreadsheet/base-64-string/tagHelper %}
232
+
{% endhighlight %}
233
+
{% highlight c# tabtitle="OpenController.cs" %}
234
+
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
{% include code-snippet/spreadsheet/base-64-string/razor %}
243
+
{% endhighlight %}
244
+
{% highlight c# tabtitle="OpenController.cs" %}
245
+
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
246
+
{% endhighlight %}
247
+
{% endtabs %}
248
+
{% endif %}
249
+
221
250
### External workbook confirmation dialog
222
251
223
252
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.
@@ -432,6 +461,37 @@ The following code snippet demonstrates how to configure the serialization optio
432
461
{% endtabs %}
433
462
{% endif %}
434
463
464
+
### To Save Spreadsheet data as a Base64 string
465
+
466
+
In the Spreadsheet control, there is currently no direct option to save and open data as a `Base64` string. You can achieve this by saving the Spreadsheet data as blob data and then converting that saved blob data to a `Base64` string using `FileReader`.
467
+
468
+
> You can get the Spreadsheet data as blob in the [saveComplete](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_SaveComplete) event when you set the `needBlobData` as **true** and `isFullPost` as **false** in the [beforeSave](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event.
469
+
470
+
The following code example shows how to save the spreadsheet data as base64 string.
471
+
472
+
{% if page.publishingplatform == "aspnet-core" %}
473
+
474
+
{% tabs %}
475
+
{% highlight cshtml tabtitle="CSHTML" %}
476
+
{% include code-snippet/spreadsheet/base-64-string/tagHelper %}
477
+
{% endhighlight %}
478
+
{% highlight c# tabtitle="OpenController.cs" %}
479
+
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
In the Spreadsheet control, there is currently no direct option to save and open data as a `Base64` string. You can achieve this by saving the Spreadsheet data as blob data and then converting that saved blob data to a `Base64` string using `FileReader`.
496
-
497
-
> You can get the Spreadsheet data as blob in the [saveComplete](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_SaveComplete) event when you set the `needBlobData` as **true** and `isFullPost` as **false** in the [beforeSave](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event.
498
-
499
-
The following code example shows how to save and open the spreadsheet data as base64 string.
500
-
501
-
{% if page.publishingplatform == "aspnet-core" %}
502
-
503
-
{% tabs %}
504
-
{% highlight cshtml tabtitle="CSHTML" %}
505
-
{% include code-snippet/spreadsheet/base-64-string/tagHelper %}
506
-
{% endhighlight %}
507
-
{% highlight c# tabtitle="OpenController.cs" %}
508
-
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
0 commit comments