Export some columns in excel

Hi:

I am using GroupingGridExcelConverterControl to export to excel file. How can I export some columns instead of all the columns.

Thank you,
Bina Thakkar

1 Reply

RC Rajadurai C Syncfusion Team April 15, 2010 05:00 PM UTC

Hi Bina,

Thanks for your interest in Syncfusion Products.

There are no property settings available by default in GroupingGridExcelConverterControl class to control the export of columns as the export take place only by considering each row as element. Hence it has to be handled manually through some code.

Please refer to the attached sample in which a class called SelectedRangeExport deriving from GroupingGridExcelConverterControl has been added which exports the number of columns set even the grid holds larger than that.

SelectedRangeExcelExportControl ExcelAdv = new SelectedRangeExcelExportControl();// derived control object
ExcelAdv.SelectedExport(this.gridGroupingControl1.TableModel, saveFileDialog.FileName,colCount); // colCount refers to the number of columns you would like to export.

Sample:
http://help.syncfusion.com/support/samples/Grid.Windows/7.1.0.30/I62024a.zip

Let me know if you have any further queries.

Regards,
Rajadurai

Loader.
Up arrow icon