Skip to content

Commit 1441bad

Browse files
Merge pull request #3010 from syncfusion-content/EJ2-889454-dev
documentation(889454): Need to move the following sections from How To section to feature section in Spreadsheet UG
2 parents 052d30a + d914b57 commit 1441bad

12 files changed

+178
-251
lines changed

ej2-asp-core-mvc/spreadsheet/filter.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,35 @@ When you want to reapply the filter after some changes happened in the rows. It
9494
The following errors have been handled for filtering,
9595
* *Out of range validation:* When the selected range is not a used range of the active sheet, it is considered as invalid and the out of range alert with the message `Select a cell or range inside the used range and try again` will be displayed. No filter will be performed if the range is invalid.
9696

97+
## Get the filtered rows
98+
99+
Filtering allows you to view specific rows in a spreadsheet while hiding the others. The [allowFiltering](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowFiltering) property allows you to enable or disable filtering functionality through the UI. You can also use the [allowFiltering](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowFiltering) property and `applyFilter` method combination to filter data via code behind. The filtered rows can be identified by iterating through the row collection on the sheet and using the `isFiltered` property available in each row object.
100+
101+
The following code example shows how to get the filtered rows.
102+
103+
{% if page.publishingplatform == "aspnet-core" %}
104+
105+
{% tabs %}
106+
{% highlight cshtml tabtitle="CSHTML" %}
107+
{% include code-snippet/spreadsheet/filter-cs1/tagHelper %}
108+
{% endhighlight %}
109+
{% highlight c# tabtitle="InsertSheetController.cs" %}
110+
{% include code-snippet/spreadsheet/filter-cs1/filterController.cs %}
111+
{% endhighlight %}
112+
{% endtabs %}
113+
114+
{% elsif page.publishingplatform == "aspnet-mvc" %}
115+
116+
{% tabs %}
117+
{% highlight razor tabtitle="CSHTML" %}
118+
{% include code-snippet/spreadsheet/filter-cs1/razor %}
119+
{% endhighlight %}
120+
{% highlight c# tabtitle="InsertSheetController.cs" %}
121+
{% include code-snippet/spreadsheet/filter-cs1/filterController.cs %}
122+
{% endhighlight %}
123+
{% endtabs %}
124+
{% endif %}
125+
97126
## Limitations
98127

99128
The following features have some limitations in Filter:

ej2-asp-core-mvc/spreadsheet/how-to/get-filtered-rows.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

ej2-asp-core-mvc/spreadsheet/how-to/import-an-excel-document-using-file-uploader.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

ej2-asp-core-mvc/spreadsheet/how-to/insert-sheet-programmatically-and-make-it-the-active-sheet.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

ej2-asp-core-mvc/spreadsheet/how-to/print.md

Lines changed: 0 additions & 37 deletions
This file was deleted.

ej2-asp-core-mvc/spreadsheet/how-to/save-and-open-spreadsheet-data-as-base64-string.md

Lines changed: 0 additions & 40 deletions
This file was deleted.

ej2-asp-core-mvc/spreadsheet/how-to/sort-a-range-by-custom-list.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

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

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

143+
### Import an excel document using file uploader
144+
145+
If you explore your machine to select and upload an excel document using the file uploader, you will receive the uploaded document as a raw file in the `success` event of the file uploader. In this `success` event, you should pass the received raw file as an argument to the Spreadsheet's `open` method to see the appropriate output.
146+
147+
The following code example shows how to import an excel document using file uploader in spreadsheet.
148+
149+
{% if page.publishingplatform == "aspnet-core" %}
150+
151+
{% tabs %}
152+
{% highlight cshtml tabtitle="CSHTML" %}
153+
{% include code-snippet/spreadsheet/open-uploader/tagHelper %}
154+
{% endhighlight %}
155+
{% highlight c# tabtitle="Opencontroller.cs" %}
156+
{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %}
157+
{% endhighlight %}
158+
{% endtabs %}
159+
160+
{% elsif page.publishingplatform == "aspnet-mvc" %}
161+
162+
{% tabs %}
163+
{% highlight razor tabtitle="CSHTML" %}
164+
{% include code-snippet/spreadsheet/open-uploader/razor %}
165+
{% endhighlight %}
166+
{% highlight c# tabtitle="Opencontroller.cs" %}
167+
{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %}
168+
{% endhighlight %}
169+
{% endtabs %}
170+
{% endif %}
171+
143172
### Configure JSON deserialization options
144173

145174
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.
@@ -189,6 +218,35 @@ The following code snippet demonstrates how to configure the deserialization opt
189218
{% endtabs %}
190219
{% endif %}
191220

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+
192250
### External workbook confirmation dialog
193251

194252
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.
@@ -403,6 +461,37 @@ The following code snippet demonstrates how to configure the serialization optio
403461
{% endtabs %}
404462
{% endif %}
405463

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+
406495
### Supported file formats
407496

408497
The following list of Excel file formats are supported in Spreadsheet:
@@ -461,6 +550,7 @@ Open and save helper functions are shipped in the Syncfusion.EJ2.Spreadsheet pac
461550
| 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) |
462551
| 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) |
463552

553+
464554
## See Also
465555

466556
* [Filtering](filter)

0 commit comments

Comments
 (0)