Skip to content

Commit d914b57

Browse files
committed
889454: Addressed review comments.
1 parent 9414703 commit d914b57

File tree

1 file changed

+60
-30
lines changed

1 file changed

+60
-30
lines changed

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

Lines changed: 60 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,35 @@ The following code snippet demonstrates how to configure the deserialization opt
218218
{% endtabs %}
219219
{% endif %}
220220

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 %}
235+
{% endhighlight %}
236+
{% endtabs %}
237+
238+
{% elsif page.publishingplatform == "aspnet-mvc" %}
239+
240+
{% tabs %}
241+
{% highlight razor tabtitle="CSHTML" %}
242+
{% 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+
221250
### External workbook confirmation dialog
222251

223252
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
432461
{% endtabs %}
433462
{% endif %}
434463

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 %}
480+
{% endhighlight %}
481+
{% endtabs %}
482+
483+
{% elsif page.publishingplatform == "aspnet-mvc" %}
484+
485+
{% tabs %}
486+
{% highlight razor tabtitle="CSHTML" %}
487+
{% include code-snippet/spreadsheet/base-64-string/razor %}
488+
{% endhighlight %}
489+
{% highlight c# tabtitle="OpenController.cs" %}
490+
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
491+
{% endhighlight %}
492+
{% endtabs %}
493+
{% endif %}
494+
435495
### Supported file formats
436496

437497
The following list of Excel file formats are supported in Spreadsheet:
@@ -490,36 +550,6 @@ Open and save helper functions are shipped in the Syncfusion.EJ2.Spreadsheet pac
490550
| ASP.NET MVC4 | Syncfusion.EJ2.MVC4 <br/>Syncfusion.EJ2.Spreadsheet.AspNet.MVC4 <br/> Syncfusion.Compression.Base <br/> Syncfusion.XlsIO.AspNet.Mvc4 <br/> Syncfusion.ExcelToPdfConverter.AspNet.Mvc4 <br/> | [Syncfusion.EJ2.Spreadsheet.AspNet.MVC4](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.MVC4) <br/> [Syncfusion.ExcelToPdfConverter.AspNet.Mvc4](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc4) |
491551
| ASP.NET MVC5 | Syncfusion.EJ2.MVC5 <br/>Syncfusion.EJ2.Spreadsheet.AspNet.MVC5 <br/> Syncfusion.Compression.Base <br/> Syncfusion.XlsIO.AspNet.Mvc5 <br/> Syncfusion.ExcelToPdfConverter.AspNet.Mvc5 <br/> | [Syncfusion.EJ2.Spreadsheet.AspNet.MVC5](https://www.nuget.org/packages/Syncfusion.EJ2.Spreadsheet.AspNet.MVC5) <br/> [Syncfusion.ExcelToPdfConverter.AspNet.Mvc5](https://www.nuget.org/packages/Syncfusion.ExcelToPdfConverter.AspNet.Mvc5) |
492552

493-
## Save and Open data as a Base64 string
494-
495-
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 %}
509-
{% endhighlight %}
510-
{% endtabs %}
511-
512-
{% elsif page.publishingplatform == "aspnet-mvc" %}
513-
514-
{% tabs %}
515-
{% highlight razor tabtitle="CSHTML" %}
516-
{% include code-snippet/spreadsheet/base-64-string/razor %}
517-
{% endhighlight %}
518-
{% highlight c# tabtitle="OpenController.cs" %}
519-
{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %}
520-
{% endhighlight %}
521-
{% endtabs %}
522-
{% endif %}
523553

524554
## See Also
525555

0 commit comments

Comments
 (0)