Grid Excel-Export: When exporting grid, values are being changed to wrong format

Dear all, 

I am currently facing the following issue with a data in an MVC5 application. The values displayed in the grid when running the application are fine (screen capture 1). However, once exported the values appear to have been modified during export (screen capture 2). Ideally, the value displayed in the grid should be exported to the Excel file as is. I came across the following post here in the community forum, but I am not if that is the key to resolving my present issue. Would be grand if someone could be of assistance regarding this matter.

This is the basic setup of the grid I am currently using

<div class="gridview">

    @{
        List<object> cols = new List<object>();
        cols.Add(new { field = "SomeFieldName", direction = "Descending" });
    }

    @Html.EJS().Grid("Grid").Locale("de").DataSource((IEnumerable<object>)ViewBag.DataSource).Height(500).Width("100%").ToolbarClick("toolbarClick").AllowSorting().AllowFiltering(true).AllowReordering().AllowResizing(true).Columns(col =>
    {
        col.Field("SomeFieldName01").HeaderText("ColName01").Add();
        col.Field("SomeFieldName02").HeaderText("ColName02").Format("dd.MM.yyyy HH:mm:ss").Add();
        col.Field("SomeFieldName03").HeaderText("ColName03").Format("C2").Add();
        col.Field("SomeFieldName04").HeaderText("ColName04").Add();
        col.Field("SomeFieldName05").HeaderText("ColName05").Add();
        col.Field("SomeFieldName06").HeaderText("ColName06").Add();
        col.Field("SomeFieldName07").HeaderText("ColName07").Format("C2").Add();
        col.Field("SomeFieldName08").HeaderText("ColName08").Format("C2").Add();
        col.Field("SomeFieldName09").HeaderText("ColName09").Add();
        col.Field("SomeFieldName10").HeaderText("ColName10").Add();
    }).AllowPaging().DataBound("dataBound").Toolbar(new List<string>() { "ExcelExport" }).AllowExcelExport(true).SortSettings(sort => sort.Columns(cols)).Render()
</div>

 function toolbarClick(args) {
        var gridInstance = document.getElementById("Grid").ej2_instances[0];
        if (args.item.text === 'Excel Export') {
            gridInstance.excelExport();
        }
    }


sc01_02.png = Values being displayed correctly in the grid 
sc02_02_excel.PNG = Exported values with incorrect number format.


Thanks a mil in advance for any help provided. 

Kind regards
Chris

Attachment: images_8eae9568.zip

7 Replies

SK Sujith Kumar Rajkumar Syncfusion Team May 29, 2020 07:25 AM UTC

Hi Chris, 

Greetings from Syncfusion support. 

We checked your reported problem but unfortunately were unable to reproduce it from our end as the values were properly exported to excel with ‘C2’ format. Please check below sample for your reference, 


We suspect this problem might be occurring because of not loading the required culture files for ‘de’ culture in your application. So can you please ensure this case in your application using the above sample. 

If problem still persists it will be helpful to identify it better if you could share us the following information, 

  • Grid related code file(No need data bound in Grid).
  • Sample data for the value displayed in ‘C2’ format column.
  • Syncfusion package version used.

Let us know if you have any concerns. 

Regards, 
Sujith R 



CR CR May 29, 2020 09:12 AM UTC

Dear Sujith,

Thanks a mil for your reply and your suggestions. As requested I prepared some sample files with regards to how the grid is populated.
Please note that I had to modify the files and I hope that they're not too messed up. The data source for this grid is a csv file
that is being converted using classic POCOs and a third party component to map csv content to the POCO. 

While not relevant for the present issue, I would like to point out that I am using another grid in another view. Although the other grid
is populated in a different manner, the numbers - once exported to Excel - are also in the wrong format. 

I also attached a file named correctly_displayed_amount.html which demonstrates that the number in question is displayed correctly in the
grid. I also checked the values displayed in the second grid I mentioned and can confirm that these values are displayed correctly, irrespective
of the method used to populate said grid. 

Also as requested, I would like to add that I am using Syncfusion.EJ2.MVC5.18.1.0.54 across the application. 

Thanks a mil in advance for taking a close look into that matter. Please do let me know if you require additional information.

Looking forward to your reply

Kind regards 

Chris

Attachment: syncfusion_grid_sample_files_e891141d.zip


SK Sujith Kumar Rajkumar Syncfusion Team June 1, 2020 12:05 PM UTC

Hi Chris, 

Thanks for the information. 

We were able to reproduce the reported problem – “Number column format issue in exported excel document with globalization” from our end and have logged defect report for the same. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and will include the defect fix in our patch release scheduled on June 17th 2020. We appreciate your patience until then.  

You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  


Let us know if you have any concerns. 

Regards, 
Sujith R 



SK Sujith Kumar Rajkumar Syncfusion Team June 18, 2020 12:42 PM UTC

Hi Chris, 

Sorry for the inconvenience. Due to some internal complexities we were unable to include the fix in the promised timeline. 

We will include the fix in our upcoming patch release scheduled on 24th June 2020. Until then your patience is appreciated. 

Let us know if you have any concerns. 

Regards,
Sujith R 



SK Sujith Kumar Rajkumar Syncfusion Team June 24, 2020 06:04 AM UTC

Hi Chris, 

We deeply regret the inconvenience caused. As we are facing some complexities with this bug in the source level, we are unable to include the fix as promised. We are currently working on it with high priority and will include it in our patch release scheduled during the mid of July 2020. Until then your patience is appreciated. 

Let us know if you have any concerns. 

Regards, 
Sujith R 



SK Sujith Kumar Rajkumar Syncfusion Team August 5, 2020 06:56 AM UTC

Hi Chris, 

We have fixed this issue internally from our side but due to some internal problems we were unable to include the fix in the patch releae as promised. However this will be included in our upcoming patch release scheduled to be rolled out on August 12th 2020. 

We deeply regret the inconvenience caused and appreciate your patience until then. 

Regards, 
Sujith R 



SK Sujith Kumar Rajkumar Syncfusion Team August 19, 2020 06:38 AM UTC

Hi Chris, 

Sorry for the delay in including the fix. 

We are glad to announce that our Essential Javascript2 patch release (v18.2.54) has been rolled out successfully and in that release we have added the fix for Number column format issue in exported excel document with globalization issue. So please update your package to this version to include the fix. 

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, 
Sujith R 


Loader.
Up arrow icon