public void ExcelExport()
{
string gridModel = HttpContext.Current.Request.Params["GridModel"];
GridProperties gridProperty = ConvertGridObject(gridModel);
ExcelExport exp = new ExcelExport();
IEnumerable<Order> result = db.Orders.ToList();
gridProperty.SummaryRows = new List<SummaryRow>() ;
exp.Export(gridProperty, result, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron");
} |
Hi Lory,
Thanks for contacting Syncfusion support.
Query: Is there a way to exclude the Summary Row in the excel export of while still showing it in the grid?We have achieved your requirement by creating the new list of object when exporting the Grid. So that
summary row value get 0 and summary row is not exported but it will be displayed on Grid. Please refer
the below code snippet
public void ExcelExport(){string gridModel = HttpContext.Current.Request.Params["GridModel"];GridProperties gridProperty = ConvertGridObject(gridModel);ExcelExport exp = new ExcelExport();IEnumerable<Order> result = db.Orders.ToList();gridProperty.SummaryRows = new List<SummaryRow>() ;exp.Export(gridProperty, result, "Export.xlsx", ExcelVersion.Excel2010, false, false, "flat-saffron");}
We have prepared a sample, the same can be downloaded from below link.
Sample: http://www.syncfusion.com/downloads/support/directtrac/176468/ze/WebApiSample_Modified_(2)2088539223
If you have any queries please get back to us.
Regards,Vignesh Natarajan.
This is exactly what I need. Thanks!