Hey guys, we just have the following issue:
We have a grid with resized column widths -> the colmun.Width property gets values like "72.239123".
The code in yourGridExcelExport.cs looks like this:
Decimal result;
if (Decimal.TryParse(gridColumn.Width, out result))
gridColumn.Width = Math.Round(result).ToString((IFormatProvider) CultureInfo.InvariantCulture);
this.Sheet.Columns[this.colIndex - 1].Width = string.IsNullOrEmpty(gridColumn.Width) || !(gridColumn.Width != "auto") ? 120 : (gridColumn.Width.IndexOf("px", StringComparison.Ordinal) > 0 ? Convert.ToInt32(gridColumn.Width.Split("px")[0], (IFormatProvider) CultureInfo.InvariantCulture) : Convert.ToInt32(gridColumn.Width, (IFormatProvider) CultureInfo.InvariantCulture));
The issue: Decimal.TryParse call turns "
72.239123" into 72239123 (I guess because we are in germany and the culture is "de-DE", so we use ',' for decimals and '.' for thousands). If the number has more decimal widgets the "Convert.ToInt32" call will throw an exception because the value is bigger than allowed for Int32. I think there should be an option to pass the current culture. and use it if given for parsing.
We did not get any exceptions, and the application works fine, but nothing happens. Maybe a log would be great. We just found this while deepdiving into the issue.
Best regards
Patrick
Hi Patrick,
Thanks for your patience.
We are glad to announce that our Essential Studio 2022 Volume 1 release v20.1.0.47 is rolled out and is available for download under the following link.
In this release, we have included the fix for the issue “Excel export not working with other cultures after column resizing”.
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Vignesh Natarajan