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.

GroupingGridExcelConverterControl

Thread ID:

Created:

Updated:

Platform:

Replies:

78271 Dec 7,2008 02:51 AM Dec 8,2008 02:02 AM Windows Forms 1
loading
Tags: GridControl
Alenoosh Zomorodian
Asked On December 7, 2008 02:51 AM

How can i have column header text instead of the column field name when exporting to Excel.
is there any reason that "GroupingGridToExcel" method of "GroupingGridExcelConverterControl" exports the field name? or it is a bug!


Thank you
Alenoosh


Nisha Arockiya A [Syncfusion]
Replied On December 8, 2008 02:02 AM

Hi Alenoosh,

Thanks for your interest in Syncfusion Products.

Export HeaderText:
It is possible to export the header text to excel after setting in GridGroupingControl using


//Setting Header text..
private void SetHeaderText(GridModel grid, IWorksheet sheet)
{
//Pass the Range and assign the Header Text
sheet.Range[3, 1].Text = "MyColumn1";
sheet.Range[3, 2].Text = "MyColumn2";
sheet.Range[3, 3].Text = "MyColumn3";
}

///Exporting to Excel..
Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
IWorkbook myWorkBook = ExcelUtils.CreateWorkbook(1);
IWorksheet sheet = myWorkBook.Worksheets[0];
converter.GroupingGridToExcel(this.gridGroupingControl1, sheet, Syncfusion.GridExcelConverter.ConverterOptions.Default);
SetHeaderText(this.gridGroupingControl1.TableModel, sheet);


Here is a minimal sample;
http://websamples.syncfusion.com//samples/Grid.Windows/Development/GGC_ExcelExport.zip

Please let me know if this helps.

Regards,
Nisha



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.

;