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. Image for the cookie policy date
close icon

Grid Grouping control - Export to excel issue

Hi,

I am using GridGroupingControl and binding the data table in the page load. There are more customizations depening on the logic with respect to the grid column values. Iam able to bind the data and customize it. But when i export the grid to excel/word i don't have the actual values in the grid. I am gettting the values which are there in the datable.

//In Page load im binding the datatable to the grid.
//This datatable has been customized to display, like
//making some of the date calculations and hyperlink coloumns

protected void Page_Load(object sender, EventArgs e)
{

this.GridGroupingControl1.DataSource = GetAllProjects();//This is a datatable
GridGroupingControl1.ShowSearchBox = true;
this.GridGroupingControl1.ShowGroupDropArea = true;
}

//Export to excel
protected void btnExportExcel_Click(object sender, EventArgs e)
{
GridExcelExport excel = new GridExcelExport(this.GridGroupingControl1, "excel.xls");
excel.ExportNestedTable = true;
excel.Export();

}

How should i proceed to export the grid with latest changes instead of raw datatable to excel.



5 Replies

ES Eswari S Syncfusion Team December 21, 2011 07:17 AM UTC

Hi Vijay,

Thank you for using Syncfusion products.

Query #1 : when i export the grid to excel/word i don't have the actual values in the grid

By default , actual values which is persisted in grid ( latest Updated value , sorting , etc ) will be exported to the excel/word except unbound columns like ( eg ,hyperlink columns ). We can only export the bound columns to the excel/word .If you would like to export the visible rows of grid in current page , you need to set the property ConverterOptionsExt.Visible. Please refer to the following code snippets:

protected void Button2_Click(object sender, EventArgs e)
{
GridWordExport excel = new GridWordExport(this.GridGroupingControl1, "WordDoc.docx",ConverterOptionsExt.Visible); // set ConverterOptionsExt.Visible
excel.ExportNestedTable = true;
excel.Export();

}

We have prepared the video demonstrating the working of the sample and the same can be downloaded from the following link.

Sample Link:

ExcelExport Issue312164948.zip

Video Link:

Video1936521315.zip

Also, we would request you to check our online sample link:

http://asp.syncfusion.com/sfaspnetsamplebrowser/9.4.0.62/Web/Grid.Grouping.Web/Samples/4.0/Export%20and%20Print/Word%20Export/CS/WordExport.aspx


Please try this and let us know if you have any other queries.

Regards,
Eswari.S




VJ Vijay Jayaraj January 5, 2012 06:06 AM UTC

I got it resolved by the "ConverterOptionsExt" properties, however i am not able to get the grid footer in the excel when i export the grid.

I need to provide legends at the bottom of all the records in the excel sheet along with summaries.

Please suggest.



RR Ranjithkumar R G Syncfusion Team January 10, 2012 10:35 AM UTC

Hi Vijay ,

Thanks for your update.

We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample and the same can be downloaded from the following link.

http://www.syncfusion.com/downloads/Support/DirectTrac/88902/ExcelExport%20Issue348156241.zip

Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.

Please let us know if any concerns.

Regards,
Ranjithkumar




VJ Vijay Jayaraj January 16, 2012 10:06 AM UTC

Thanks Ranjith, that works great but the caption text was distorted.

- Vijay



RR Ranjithkumar R G Syncfusion Team January 18, 2012 02:38 PM UTC

Hi Vijay,

Thanks for your update.

We are sorry for inconvenience caused. We are unable to reproduce the issue. We have prepared a simple sample and the same can be downloaded from the following links.

Sample link:
http://www.syncfusion.com/downloads/Support/DirectTrac/88902/ExcelExport%20Issue348156241.zip

Could you please try the above sample and get back to us whether you are able to reproduce the issue? If not, could you please give more information or by reproducing the issue in the above sample so that we could sort out the issue and provide you with solution. The information provided would be of great help in resolving the issue.

Please let us know if any concerns.

Regards,
Ranjithkumar



Loader.
Live Chat Icon For mobile
Up arrow icon