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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reg: Export from GridGrouping control to Excel

Thread ID:

Created:

Updated:

Platform:

Replies:

34439 Sep 9,2005 05:40 AM UTC Sep 9,2005 02:27 PM UTC WinForms 1
loading
Tags: GridControl
Anna Srinivasan
Asked On September 9, 2005 05:40 AM UTC

Hi, I have attached one class file and excel file regarding export data from grid grouping control to excel.Export to excel class file i have taken from syncfusion. Basically, in my contol i dont want to show first three columns in the excel sheet. For that i have added one condition in line No: 159(ie. i have made first three column width equal to zero) But my problem is in the excel sheet header does''t start from ''A''(b''cause i have made first three column width equal to zero) Is it possible to get excel header start from ''A''. And one more thing is, I dont know, why the first row always start from line no:2 in excel sheet. Any idea on this scenario....! GG to Excel_4761.zip

Administrator [Syncfusion]
Replied On September 9, 2005 02:27 PM UTC

I think you can handle this by not adding those columns to Excel at all. You can try to do this by using code like this every time you loop through the columns.
int offset = 0;
if (j == 2 || j == 3 || j == 4) {
	sheet.Range[1,j+1].ColumnWidth = 0;
} else {
	if (grid.TableModel.ColWidths[j] == 0){
		offset = 3;
	} else {
		sheet.Range[1,j+1-offset].ColumnWidth = (grid.TableModel.ColWidths[j]/7.43);
	}
}
You would need to do something similar in every loop through the columns, skipping 2,3,4 and offsetting the column indexes in the excel sheet by 3 as needed.

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

;