Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Tue Jul 19, 2022 10:06 am

Hello,

our clients reported the following issue:

Date format is ignored after merge when the Windows regional settings are EU. Template and examples are attached.

We use the Spire.Office 7.7.2.

Regards

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Wed Jul 20, 2022 10:56 am

Thanks for your inquiry.

I initially tested your case, but did not reproduce your issue. To help investigate further, please provide us with the following more information:
1. Your system information (E.g. Win7, 64 bit) ;
2. The target platform of your project(E.g. .NET framework 4.8 )

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Wed Jul 20, 2022 12:50 pm

Hello,

We tested on Windows 10, 64 bit with latest updates.
The project target framework is .NET Framework 4.7.2
Spire.Officefor.NETStandard 7.7.2

If we use English (United States) regional settings the fields are merged correctly:

Wednesday, July 20 2022
Wed, 20 Jul 2022
2022.07.20
20.07.2022
20-7-22

If we switch to Dutch (Netherlands) regional settings the fields are NOT merged correctly:

20-7-2022 15:41:27
20-7-2022 15:41:27
20-7-2022 15:41:27
20-7-2022 15:41:27
20-7-2022 15:41:27

To change the settings go to Control Panel -> Clock and Region -> Region -> Format

We use similar code:

Code: Select all
var data = new DataTable();
data.Columns.Add(new DataColumn("Investor_Fiscalyearend", typeof(DateTime)));
data.Columns.Add(new DataColumn("Investor_Name", typeof(string)));

var r = data.Rows.Add();
r["Investor_Name"] = "IA1";
r["Investor_Fiscalyearend"] = DateTime.Now;

foreach (DataRow dr in data.Rows)
{
    using (var document = new Doc.Document())
    {
        document.LoadFromFile(template);
        document.MailMerge.ClearFields = true;

        var resultFile = Path.GetTempFileName() + ".docx";

        document.MailMerge.Execute(dr);

        document.IsUpdateFields = false;

        document.ViewSetup.DocumentViewType = DocumentViewType.PrintLayout;
        document.SaveToFile(resultFile);

        Process.Start(resultFile);
    }
}

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Thu Jul 21, 2022 5:43 am

Hello,

Thanks for more information.
When I tested with your code, I did reproduce the problem you mentioned. I have logged this issue into our tracking system using ticket SPIREDOC-8203. Our development team will further investigate and fix it. I will keep you informed as soon as there is any progress. Sorry for the inconvenience.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Tue Dec 20, 2022 10:25 am

Hello,

Thank you for your patience.
For the issue SPIREDOC-8203, please add the following code to the first line of your program to avoid it.
Code: Select all
Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
var data = new DataTable();
data.Columns.Add(new DataColumn("Investor_Fiscalyearend", typeof(DateTime)));
data.Columns.Add(new DataColumn("Investor_Name", typeof(string)));

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Tue Dec 20, 2022 6:35 pm

Thanks for the reply.

The same DataTabe is used as data source for grid in UI and for merge. Using an invariant culture will not respect regional settings in the user interface as well as in the merged document.

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Wed Dec 21, 2022 7:28 am

Hello,

Thanks for more information.
For your issue, I have added it back to our tracking system using ticket SPIREDOC-8907. Our development team will further investigate and fix it. I will keep you informed as soon as there is any progress. Sorry for the inconvenience.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Mon Jun 19, 2023 11:16 am

Hello again,

our clients who reported the issue wants an update.

Thanks in advance!

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Tue Jun 20, 2023 7:09 am

Hello,

Thanks for your message.
Sorry the issue of SPIREDOC-8907 is not resolved yet. Our development team is still investigating and working on it. I have urged our Dev team. Please spare us more time. Once its’ hotfix version is available, we will inform you as soon as possible. Thank you for your understanding.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1510
Joined: Wed Apr 25, 2018 3:20 am

Mon Oct 30, 2023 6:42 am

Hello.

Our clients want updates on this again. Can you provide an update?

Thanks,
Velislav

profiler007
 
Posts: 73
Joined: Wed Nov 13, 2019 11:32 am

Mon Oct 30, 2023 10:24 am

Hello,
Thanks for your message.

Sorry, no breakthrough progress has been made on the issues of SPIREDOC-9559 and SPIREDOC-8907. We further urge our developers to investigate these two issues. Once there is any progress, I will inform you as soon as possible. Sorry again for the inconvenience caused to you.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 732
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.Doc