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.
Syncfusion Feedback

Exclude Summary Row in Excel Export

Thread ID:

Created:

Updated:

Platform:

Replies:

131155 Jun 23,2017 08:48 PM UTC Jun 28,2017 05:44 AM UTC JavaScript 3
loading
Tags: ejGrid
Lory
Asked On June 23, 2017 08:48 PM UTC

Hi Team,

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



Thanks!

Vignesh Natarajan [Syncfusion]
Replied On 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.  


Lory
Replied On 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!


Venkatesh Ayothi Raman [Syncfusion]
Replied On 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. 


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.

Warning Icon 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.Close Icon

;