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.

A filtered GridGroupingControl - sending the filtered data to a Excel worksheet

Thread ID:

Created:

Updated:

Platform:

Replies:

96284 Sep 2,2010 03:37 PM Sep 7,2010 07:56 AM Windows Forms 3
loading
Tags: GridControl
David Mecteaux
Asked On September 2, 2010 03:37 PM

I would like to send the filtered data of a GridGroupingControl to a excel worksheet. I am using some sample code but that only sends the whole table (with no filtereing) to the Excel sheet. How can I just send the data that is being show on the datagrid? Here is the code I was using...



string fileName;
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2010;
fileName = "Sample.xlsx";
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];

if(gridReport.DataSource != null)
{
sheet.ImportDataTable((DataTable)gridReport.DataSource, true, 3, 1, -1, -1);

//??sheet.ImportDataView(new DataView(gridReport
}
.
.


}


Jisha Joy [Syncfusion]
Replied On September 3, 2010 06:34 AM

Hi David,

You could achieve the desired behavior by using GroupingGridExcelConverterControl and setting the ConverterOptions to visible.

Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new
Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
converter.GroupingGridToExcel(this.gridGroupingControl1,
"sample.xls", Syncfusion.GridExcelConverter.ConverterOptions.Visible);



Regards,
Jisha


David Mecteaux
Replied On September 3, 2010 10:51 AM

Well I am doing something like that already....but I was looking at the ExcelEngine class and was thinking about some advanced things I could do to when I export to Excel from the GridGroupingControl.


Jisha Joy [Syncfusion]
Replied On September 7, 2010 07:56 AM

Hi David,

Thank you for your update. Is it Possible for you to provide us a sample showing the issue?.

Regards,
Jisha


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.

;