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

Issue with Value2 property in XLSIO excel

HI,
I have a data grid from which I am exporting data to excel. Note that the regional settigns I am using is of Denmark(danish) and when I try to export data the value2 property always removes the decimal point(.) and makes it as continous string. That is, if I have value 123.0.1.0 it will convert to 123010 which is not expected. One more issue is, when I have some date string ex "01-01-2000" and I export the value2 shows it as some junk value and same appears in excel. This is really eating my time to fix the issue.
Is this some thing related to regional setting, if yes then need  a solution to which makes it to work irrespective of cultural settings.
Pasted piece of code which I am looking into,
Note: Here valueObj is object

  if (dataType != null && dataType.ToString().Contains("System.DateTime"))
                {
                  iRange.Value2 = valueObj;
                  iRange.CellStyle.NumberFormat = this._DateTimeFormatTables;
                }
                else
                {
                  iRange.Value2 = valueObj;
                  iRange.NumberFormat = ExcelFormatType.General.ToString();
                }

I tried using value instead of Value2, but no use.

Need help ASAP. 



1 Reply

VS Vikas Sekar Syncfusion Team March 20, 2015 04:47 PM UTC

Hi Mahesh,

Thank you for using Syncfusion products.

When I try to export data the value2 property always removes the decimal point(.) and makes it as continous string. That is, if I have value 123.0.1.0 it will convert to 123010 which is not expected.

We are able to reproduce the issue and we suspect this to be defect. We are validating on this.

When I have some date string ex "01-01-2000" and I export the value2 shows it as some junk value and same appears in excel. This is really eating my time to fix the issue.

The reported issue is not reproducing at our side. We request you to share us the number format that is applied in this case. This will help us to investigate further and provide a prompt solution.

Please let us know if you need any clarification.

Regards,

Vikas


Loader.
Live Chat Icon For mobile
Up arrow icon