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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Mail Merge and Numberformatting

Thread ID:

Created:

Updated:

Platform:

Replies:

118247 Feb 16,2015 11:18 AM UTC Feb 19,2015 12:24 PM UTC ASP.NET Web Forms 3
loading
Tags: DocIO
Nicky Mogensen
Asked On February 16, 2015 11:18 AM UTC

Hi there.

I have trouble getting the mail merge feature to format my numbers correctly.

If I add a Mail Merge field like listed below , it ignores my format. Or actually, it trims away my decimalseparator, doesn't add thousand seperators and then and appends 0,00.

{ MERGEFIELD FieldName  \# "#.00" } 
{ MERGEFIELD FieldName  \# "#,00" }
{ MERGEFIELD FieldName \# "#,###.00%" }
{ MERGEFIELD FieldName \# "#.###,00%" }

My datasource is a Decimal.

I cannot find any documentation on this topic, which makes me wonder, if the feature even is supported?

I have created the template with DocIO, modified the fieldcode (ALT+F9) adding numberformat in Word 2013. Generated document based on the template with DocIO and views the document in Word 2013.

I have found out, that if I make a formula, as {=({ MERGEFIELD FieldName} + 0) \# "0,000.00" } then I can get it formatted - in English format only. Everything is set to Danish, environment, global culture etc.

I appreciate any feedback.

//Nicky


Sathish K [Syncfusion]
Replied On February 18, 2015 12:26 PM UTC

Hi Nicky,

Thank you for your interest in Syncfusion products.

Kindly specify the number format in merge field and the input string in English culture format and then change the System’s culture to the desired one (Danish) in sample level then perform the mail merge to retain the desired number format. We have prepared a sample to illustrate the same. Please find the sample from below link:

Sample link:
http://www.syncfusion.com/downloads/support/directtrac/118247/Sample724512912.zip

If this doesn’t resolve your issue, then kindly update us your input template document, code snippet or sample used in your side along with the expected output number format. Thereby we will analyse further on the mentioned issue and provide you appropriate solution.

Regarding issue with Formula field:
Kindly update us your test case document along with the code snippet or sample to reproduce the issue. It will help us to analyse further on the mentioned issue.

Please let us know if you have any other questions.

Regards,
Sathish



Nicky Mogensen
Replied On February 18, 2015 01:05 PM UTC

Thanks for your answer, but the sample provided has the same problem.

- Changing values on line 55 to: string[] values = { "1000.346", "1000.4635"};
- Change to US culture on line 58: System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");
- Run the sample

The output is then:

1000.35

1,000.46%

Which is correct. Both lines has two decimals, and the bottom line has a thousandseparator. 

Now  do:

- Change back to Danish culture on line 58: System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("da-DK")
- Run the sample

The output is now:

1000,35

1000,46350%

First line is fine, but the second line is missing a thousandseparator ( . ) and has too many decimals.


//Nicky



Sathish K [Syncfusion]
Replied On February 19, 2015 12:24 PM UTC

Hi Nicky,

We were able to reproduce the reported issue with number formatting and we have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents  

Please let me know if you have any questions.

Best,
Sathish



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;