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

Exclude Summary Row in Excel Export

Hi Team,

Is there a way to exclude the Summary Row in the excel export of while still showing it in the grid?



Thanks!

3 Replies

VN Vignesh Natarajan Syncfusion Team June 27, 2017 12:36 PM UTC

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. 


If you have any queries please get back to us. 

Regards, 
Vignesh Natarajan.  



LO Lory replied to Vignesh Natarajan June 27, 2017 09:59 PM UTC

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. 


If you have any queries please get back to us. 

Regards, 
Vignesh Natarajan.  


This is exactly what I need. Thanks!



VA Venkatesh Ayothi Raman Syncfusion Team June 28, 2017 05:44 AM UTC

Hi Lorry, 

Thanks for the feedback. 

We are very happy to hear that your requirement is achieved. 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon