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.

Export Excel

Thread ID:

Created:

Updated:

Platform:

Replies:

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

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 12:52 AM

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 01:57 AM


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 02:19 AM

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 03:49 AM

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 10:25 AM

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 10:56 AM

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.

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.

;