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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export GridControl to Excel

Thread ID:

Created:

Updated:

Platform:

Replies:

54234 Jan 4,2007 11:18 AM UTC Feb 27,2007 09:55 PM UTC WinForms 6
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 4, 2007 11:18 AM UTC

Hi,

I want to export gridcontrol to a excel file, how can i do it???

Thanks,
Surti

PD: I work in VB.net with GridControl version 1.5.1.1

Administrator [Syncfusion]
Replied On January 4, 2007 12:22 PM UTC

Hi Surti,

We have built-in support for exporting the grid to excel in Essentail Grid version 4.x . The shipped ExcelExport_DataBoundGrid Browser sample ( \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\Serialization\ExcelExport_DataBoundGrid\ ) hows you how to export the grid data into Excel. Please download the latest verison and let us know if you still run into any issues.

Thanks for choosing and using Syncfusion Products.

Best Regards,
Haneef

Note : There is no built-in for exporting the grid to excel in Essential Grid version 1.5.1.1

Ganesh
Replied On February 26, 2007 07:39 AM UTC

HI,

I want to export selected rows with the styles from the GridControl to the excel sheet not all the rows. How can i do that?

Thanks in Advance
Regards
Ganesh

Administrator [Syncfusion]
Replied On February 26, 2007 06:12 PM UTC

Hi Ganesh,

Here is a minimal sample that shows you "How to export the selected cell ranges with column header in the grid to excel?". Please try the attached sample and let me know if this helps.

sample : GDBGExportRowHeader.zip

Best regards,
Haneef

Ganesh
Replied On February 27, 2007 05:14 PM UTC

Hi Haneef...

Thanks a lot. I am able to do the export for the selected rows. In this i think we are exporting cell by cell manually. I have one issue in this. I have some set of rows merged for few coloumns. so when i export it doesnt merge those columns..Any suggestion for this?
Thanks in Advance
Ganesh

>Hi Ganesh,

Here is a minimal sample that shows you "How to export the selected cell ranges with column header in the grid to excel?". Please try the attached sample and let me know if this helps.

sample : GDBGExportRowHeader.zip

Best regards,
Haneef

Ganesh
Replied On February 27, 2007 05:37 PM UTC

Hi Haneef... I have already used this solution and facing this problem.. so please let me know any work around available for that.
Thanks in Advance
Ganesh

>Hi Haneef...

Thanks a lot. I am able to do the export for the selected rows. In this i think we are exporting cell by cell manually. I have one issue in this. I have some set of rows merged for few coloumns. so when i export it doesnt merge those columns..Any suggestion for this?
Thanks in Advance
Ganesh

>Hi Ganesh,

Here is a minimal sample that shows you "How to export the selected cell ranges with column header in the grid to excel?". Please try the attached sample and let me know if this helps.

sample : GDBGExportRowHeader.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 27, 2007 09:55 PM UTC

Hi Ganesh,

You can call the CopyMergesFromGrid method after calling the ExportColumnHeaders method. Here is a code snippet.

private void CopyMergesFromGrid( GridModel grid, IWorksheet sheet)
{
GridModelCoveredRanges coveredRanges = grid.CoveredRanges;
GridRangeInfoList ranges = grid.CoveredRanges.Ranges;
for( int i = 0, len = ranges.Count; i < len; i++ )
{
GridRangeInfo rangeInfo = ranges[ i ];
string strMessage = string.Format( "({0}, {1})-({2}, {3})", rangeInfo.Top, rangeInfo.Left, rangeInfo.Bottom, rangeInfo.Right );
if( rangeInfo.Top == 0 || rangeInfo.Left == 0 ) continue;
sheet.Range[ rangeInfo.Top, rangeInfo.Left, rangeInfo.Bottom, rangeInfo.Right ].Merge();
}
}

Please refer to the attached sample for more details and let me know if this helps.
GDBGExportRowHeader.zip

Best regards,
Haneef

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

;