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

GridSummaryColumnDescriptor values ​​are not displayed when exporting - Syncfusion

Hi,

I have a column of type "GridSummaryColumnDescriptor" with "SummaryType" property equal to "Custom". When I export the data, the values ​​in this column are not shown. Also, when you export nor the percentage format is not shown in the excel file. 

Please could help me with this case.

1 Reply

ES Eswari S Syncfusion Team March 12, 2014 09:55 AM UTC

Hi Jimmy,

 

Thank you for using Syncfusion products.

 

Your requirement of exporting formatting columns and Custom type summaries can be achieved by using FormatExcelCellHandler event. Please refer to the following code snippets:

 

[CS]

 

GridExcelExport excel = new GridExcelExport(this.GridGroupingControl1, "excel.xls");

        excel.ExportNestedTable = true;

        excel.FormatExcelCellHandler += new ExportExcelCellHandler(excel_FormatExcelCellHandler);

        excel.Export();

 

[Event]

 

void excel_FormatExcelCellHandler(object sender, ExcelExportEventArgs e)

    {

        if (e.RowElement.IsRecord() && e.ExcelCell.Column == 3)   // check specific column

        {

            e.ExcelCell.Cells[0].NumberFormat = "0.0%";   // set the format accordingly

        }

 

        if (e.RowElement.Kind == DisplayElementKind.Summary)

        {

           // you can process for custom summaries here

        }

    }

 

Please find sample from the attachment for your convenience.

 

 

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

 

Regards,

Eswari S

 


Attachment: Sample_bd6ca8d2.zip

Loader.
Live Chat Icon For mobile
Up arrow icon