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
115
Excel Export Number Format with DigitsInfo
posted

Hello, I am attempting to export a number dataType column to Excel that has, say a Scale of 3, so DigitsInfo of "1.3-3" and the decimal values are often always 0. So, the grid will show "5.000" correctly with the pipeArgs or a template with my own pipe, but when exported, it seems like we can EITHER:

1. Set skipFormatter to true for the column and the column will export as a number but lose the scale info

2. Preserve the scale digits info, but Excel will treat the column as Text.

It seems like having Excel format it as a number and preserving scale is mutually exclusive, but is there a way to achieve both? I also tried tapping into the rowExporting event like below to brute force a format I want, and this predictably results in #2 (preserving scale, but its text).

        exportService.rowExporting.subscribe((args: IRowExportingEventArgs) =>
        {
            args.rowData.UserRating = formatNumber(args.rowData.UserRating, this.locale, `1.3-3`);
        });
Parents Reply Children
No Data