We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Exporting only filtered data from GridView to Excel using XLSIO

Thread ID:

Created:

Updated:

Platform:

Replies:

57001 Feb 23,2007 09:02 AM Mar 6,2007 10:33 PM ASP.NET Web Forms (Classic) 2
loading
Tags: XlsIO
Administrator [Syncfusion]
Asked On February 23, 2007 09:02 AM

Hi,

Is there an easy way to export data to Excel from a GridGroupingControl after the user does filtering on a column or columns.

Please attach any sample if possible.

Thanks!!

Administrator [Syncfusion]
Replied On February 26, 2007 04:42 PM

Hi Rekha,

The Excel Export ( \Syncfusion\Essential Studio\4.4.0.49\Windows\Grid.Grouping.Windows\Samples\Serialization\Excel Export )sample demonstrates the conversion of contents in a GridGroupingControl to an xls file. The Exporting of a GridGroupingControl has two options: one converts the entire contents in the grid while the other converts only the visible contents in the grid(only filtered records).

The XlsIO libraries are used to convert the grid contents to excel. The dlls that these depend on are Syncfusion.XlsIO.Base and Syncfusion.GridConverter.Windows.

Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new
Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
converter.GroupingGridToExcel(this.gridGroupingControl1, FileName,Syncfusion.GridExcelConverter.ConverterOptions.Default);

The above code converts the entire contents in the grid. The code to export the visible or expanded records or groups alone is given below.

converter.GroupingGridToExcel(this.gridGroupingControl1, FileName, Syncfusion.GridExcelConverter.ConverterOptions.Visible);

Here is a sample.
Excel Export.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 6, 2007 10:33 PM

Hi Haneef,

Thanks for your quick response!

Is it possible to turn the autofilter ON in the Excel spreadsheet after the export of filtered data?

Thanks!


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;