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 exporting wingrid to excel
posted

Hi Mike,

After I export a column whose data type is string to excel, in the exported file, I found an issue.

The column contains a cell whose value is a percentage, three rounding positions after the decimal. When I double click the cell, it will automatically use the default round off rule and there're only two rounding positions left.

My question is how can I display three rounding positions even I double click the cell?

Pls refer to the attachment for details.

Thank you~

  • 469350
    Offline posted

    I'm not sure what double-click in the cell does. But I am guessing that the problem is that the initial value of the cell is being written to Excel as a String and not a numeric value and when you double-click, Excel is changing it to a number and formatting it with only 2 digits. The grid and the exporter have no control over how Excel converts strings into numbers. You can probably right-click on the cell in Excel and change the Format. 

    One way you might get around this is to export the value as a number instead of a string. You would have to handle the SummaryCellExported event and write a numeric value to the excel worksheet cell. I guess you would also need to set the Format on the cell.