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.
Syncfusion Feedback

Export Excel

Thread ID:

Created:

Updated:

Platform:

Replies:

52452 Nov 29,2006 05:10 AM UTC Dec 21,2010 03:56 PM UTC Windows Forms 6
loading
Tags: GridControl
Tannearu Hazarathaiah Gupta
Asked On November 29, 2006 05:10 AM UTC

Hi,
I am using Grid Data Bound Grid. I am trying to export data to Excel. Please resolve the problem ASAP.

Cheers
Tannearu Gupta

Administrator [Syncfusion]
Replied On November 29, 2006 05:52 AM UTC

Hi Tannearu,

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

Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();

The code to include both the headers during export is given below.

gecc.GridToExcel(this.gridDataBoundGrid1.Model, "YourFileName", ConverterOptions.RowHeaders,ConverterOptions.ColumnHeaders) ;

The code to exclude headers during export is given below.

gecc.GridToExcel(this.gridDataBoundGrid1.Model, saveFileDialog.FileName);


Please refer to the following sample which demonstrates the excel export in a grid.
http://www.syncfusion.com/Support/user/uploads/GDBGExport_fecc01cd.zip

Best Regards,
Haneef

Tannearu Hazarathaiah Gupta
Replied On November 29, 2006 06:57 AM UTC


Hi Haneef,
Thanks For your response. Its not working. Its exported Data. Its exporting only data. I nedd Columns Hedader should display. I add following code. Please check it once.

Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();
gecc.GridToExcel(this.gridDataBoundGrid1.Model, "c://Hazar/hazar3.xls", Syncfusion.GridExcelConverter.ConverterOptions.ColumnHeaders );


Please check it once and response me.

I am waiting for your reply.


Regards
Tannearu
>Hi Tannearu,

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

Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();

The code to include both the headers during export is given below.

gecc.GridToExcel(this.gridDataBoundGrid1.Model, "YourFileName", ConverterOptions.RowHeaders,ConverterOptions.ColumnHeaders) ;

The code to exclude headers during export is given below.

gecc.GridToExcel(this.gridDataBoundGrid1.Model, saveFileDialog.FileName);


Please refer to the following sample which demonstrates the excel export in a grid.
http://www.syncfusion.com/Support/user/uploads/GDBGExport_fecc01cd.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On November 29, 2006 07:19 AM UTC

Hi Tannearu,

Thanks for the update.

Try this code to export the grid data with column header.

Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();

//ConverterOptions.RowHeaders enumeration for exporting the columnheader in a grid.
gecc.GridToExcel(this.gridDataBoundGrid1.Model, "FileName",Syncfusion.GridExcelConverter.ConverterOptions.RowHeaders);

Best Regards,
Haneef

Tannearu Hazarathaiah Gupta
Replied On November 29, 2006 08:49 AM UTC

Hi haneef,
Thanks for your update. Its working.


Regards
Tannearu

>Hi Tannearu,

Thanks for the update.

Try this code to export the grid data with column header.

Syncfusion.GridExcelConverter.GridExcelConverterControl gecc = new Syncfusion.GridExcelConverter.GridExcelConverterControl();

//ConverterOptions.RowHeaders enumeration for exporting the columnheader in a grid.
gecc.GridToExcel(this.gridDataBoundGrid1.Model, "FileName",Syncfusion.GridExcelConverter.ConverterOptions.RowHeaders);

Best Regards,
Haneef

Hema Gunda
Replied On December 15, 2010 03:25 PM UTC

Is the same valid for Silverlight?
I am using Syncfusion 8.2.0.18 for Silverlight 3.5.
I have used the same code but in vain.
Could you suggest?

Thanks in advance.


Mohamed Suhaib Fahad A. [Syncfusion]
Replied On December 21, 2010 03:56 PM UTC

Hi Hema,

For WPF / Silverlight we have a different API and assemblies to refer to, Please check the below UG link,

http://help.syncfusion.com/ug_84/User%20Interface/WPF/Grid/default.htm?turl=Documents/exportinggdctoexcel.htm

Also, we have stopped support for Silverlight 3.0 FW and only support for Silverlight 4.0 in VS2010. Any bugs or feature enhancements would be done in this version alone.

Please let us know if you need any more assistance.

Thanks,
Fahad


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.

Warning Icon 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.Close Icon

;