Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Export to Excel Group Summary Without Details
posted

Hi, in the following example I have a sample grid which has two columns.  The first column is grouped, and the second column is summarized (using SUM and summary.DisplayFormat = "{0}" so that it won't show the 'Sum =' text):

GridGroup

 

When I export to excel, I get the following result in the excel file:

 

ExportedResult

 

My question is: is there a way to NOT export the detail rows/outline tree and only show the top group summary row?  I've used the following: Cancel on the RowExporting event, and it does remove the detail rows:

private void mygrid_RowExporting(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.RowExportingEventArgs e)
{
    if (e.CurrentOutlineLevel.Equals(0))
        e.Cancel = false;
    else
        e.Cancel = true;
}

but I am unable to figure out how to remove the rows highlighted in red.  The layout of the export that I am trying to obtain is:

DesiredResult

 

Parents Reply Children
No Data