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
270
Issue in exported excel file
posted

Hi Mike,

 I found an issue in exporting wingrid to excel.

In the summary row in the exported excel file, there are warnings in each summary cell asking me whether to convert the summary value to number type.

Please refer to the attachment for details.

How can I avoid this warning?

Thank you~

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Summaries can include text. You must be setting the DisplayFormat on your summaries to remove the text and just show the numeric values, but the grid can't interpret the format, so it still exports as text.

    What you would have to do is use the SummaryCellExported event of the UltraGridExcelExporter and write a numeric value into the WorksheetCell, instead of the string. 

    Something like this: 


            private void ultraGridExcelExporter1_SummaryCellExported(object sender, Infragistics.Win.UltraWinGrid.ExcelExport.SummaryCellExportedEventArgs e)
            {
                if (e.Summary != null)
                    e.CurrentWorksheet.Rows[e.CurrentRowIndex].Cells[e.CurrentColumnIndex].Value = e.Summary.Value;
            }

Children
No Data