We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Mergefields. Negative numbers are not formatted correctly

Hi



We use new aspose.word.dll v14.2.0.0.
Mergefields are formatted following way:
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>MERGEFIELD field1 # #,###;(#,###);0
<span lang=“EN-US” style=“font-size:10.0pt;font-family:
“Times New Roman”,“serif”;mso-fareast-font-family:“Times New Roman”;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>MERGEFIELD
field2 # “,0;(,0);0”
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>but negative numbers are displayed with additional space before (
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>sample: ( 10) ( 1,000)
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>in previouse aspose versions this worked correctly (for example in aspose.words.dll 10.5)
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>Thank you in advance
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
<span lang=“EN-US” style=“font-size:10.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>
Hi Elena,

Thanks for your inquiry. Please attach your input Word document (you're getting this problem with) along with piece of code here for testing. We will investigate the issue on our end and provide you more information.

Best regards,

Hi


Please find sample code and file in attachment

Thank you
Hi Elena,

Thanks for the additional information. While using the latest version of Aspose.Words i.e. 14.4.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The ID of this issue is WORDSNET-10165. Your thread has also been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

Hi


Is there any workaround we can use to give our clients? it is very important for them - because they have a lot of old templates

Thank you in advance

Hi Elena,


Thanks for your inquiry. I am afraid, I cannot suggest you any programmatic workaround at the moment but we will try to develop a programmatic workaround and share it with you as soon as it is ready. Moreover, the good news is that our development team has completed the analysis of this issue and the root cause has been identified. We will keep you informed of any developments and let you know as soon as this issue is resolved. We apologize for any inconvenience.

Best regards,

Hi Elena,


Thanks for being patient. We have a good news for you i.e. the fix of WORDSNET-10165 will be included in Aspose.Words 14.5.0 release which is planned to be published by the end of this month. We will inform you via this thread as soon as the May 2014 release of Aspose.Words is published.

Moreover, as a temporary workaround, you may use format without digit grouping symbol. For example:

",0;(,0);0" should be replaced by ",0;(0);0"

I hope, this helps.

Best regards,

Hi


When do you think new version of Aspose.Words will be published?

Thank you

The issues you have found earlier (filed as WORDSNET-10165) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Hi Elena,


Thanks for your inquiry. Please download Aspose.Words 14.5.0 from the following link. I hope, this helps.
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/entry550026.aspx

Best regards,

Hi


This problem is solved in new dll for
MERGEFIELD field2 # ",0;(,0);0"
but does not work for

MERGEFIELD field1 # #,###;(#,###);0

you can use same application I sent you earlier for testing. sample .doc is attached

Thank you

Hi Elena,


Thanks for your inquiry. I have performed mail merge operation using Microsoft Word 2013 on your document and attached an output document here for your reference. It produces output similar to Aspose.Words. So, this seems to be an expected behavior. If we can help you with anything else, please feel free to ask.

Best regards,

Hi


It worked in previous aspose versions. So now we have to change a lot of client templates.
is there any other workaround (so we dont have to change all client templates)?

Thank you

Hi


Also # does not work in decimal positions - additional space is displayed.
and that’s extremely incorrect
so when we have format <span lang=“EN-US” style=“font-size:10.0pt;line-height:115%;font-family:“Calibri”,“sans-serif”;
mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
mso-bidi-theme-font:minor-bidi;color:#333333;background:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”> "
<span lang=“EN-US” style=“font-size:10.0pt;line-height:115%;font-family:“Calibri”,“sans-serif”;
mso-ascii-theme-font:minor-latin;mso-fareast-font-family:Calibri;mso-fareast-theme-font:
minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-font-family:“Times New Roman”;
mso-bidi-theme-font:minor-bidi;color:#333333;background:white;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>,0.##%;(,0.##)%;0"
so when value =1 , we see ‘1 %’ instead of '1%'

Thank you


Hi Elena,


Thanks for your inquiry.
Elena:
Hi

This problem is solved in new dll for
MERGEFIELD field2 # ",0;(,0);0"
but does not work for

MERGEFIELD field1 # #,###;(#,###);0

you can use same application I sent you earlier for testing. sample .doc is attached

Thank you
For the sake of any correction, I have logged this problem in our issue tracking system as WORDSNET-10282. Our development team will further look into the details of this problem and we will keep you updated on the status of correction. We apologize for your inconvenience.
Elena:
Also # does not work in decimal positions - additional space is displayed.
and that’s extremely incorrect
so when we have format ",0.##%;(,0.##)%;0"
so when value =1 , we see ‘1 %’ instead of '1%'
Could you please attach your sample document here for testing? We will investigate the issue on our end and provide you more information.

Best regards,

Hi


Please find file attached

Thank you

Hi Elena,


Thanks for your inquiry. I tested this scenario and have managed to reproduce the same issue on my side. Again, this seems to be an expected behavior as MS Word 2013 also inserts couple of spaces between “1” and “%” (see attached out-msw-2013.docx). However, I have logged an issue (WORDSNET-10295) in our issue tracking system for our development team to mimic the behavior of old versions of Aspose.Words. Your thread has been linked to this issue and you will be notified as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-10282) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as WORDSNET-10295) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.