SUM(ABOVE) numeric formats

I’m attempting to perform a nested mailmerge by passing a dataset and Word template file. In the template I create a table and display dollar figures and calculate a total amount via the SUM(ABOVE) statement. I’m using the notation # “$#,##0.00;($#,##0.00)” throughout the Word template.

Here’s what I’m seeing…

Amount1 $150.00
Amount2 $500.00
Amount3 $600.00
Total $1250.00

I have certain scenarios where the amounts in one column are all under $999.99 but added together exceed $999.99. The SUM(ABOVE) result displays with the correct amount but without the thousands separator.

I have additional columns that include single amounts over $999.99 and the SUM(ABOVE) result displays with the thousands separator.

I’m currently using Aspose.Words 11.11 so I’m hoping this issue has been fixed since then. I’m going through release notes since 11.11 but haven’t found anything addressing SUM(ABOVE) and the thousands notation.

Hi there,

Thanks for your inquiry. It would be great if you please share following detail for investigation purposes.

  • Please attach your input Word document.

  • Please create a standalone/runnable simple application (for example a Console
    Application Project
    ) that demonstrates the code (Aspose.Words code) you used to generate your output document

  • Please attach the output Word file that shows the undesired behavior.

  • Please attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will investigate as to how you are expecting your final document be generated like.

As soon as you get these pieces of information to
us we’ll start our investigation into your issue.

I’m seeing similar behavior when updating to 14.10.0 from 9.4.

When using a SUM field that looks like below it outputs to the doc without a “,”

=SUM(ABOVE) # "$#,##0.00;($#,##0.00)"

The 2nd table in the attached document sshows how Word formats the SUM field and how Aspose.Words formats it.

The attached file “SumFieldFixture-WithValues.docx” is how word formats.
The attached file “SumFieldFixture-WithValues-PostUpdate.docx” is how Aspose.Words formats it.

The code to duplicate this is 3 lines

var doc = new Document("path.docx");
doc.UpdateFields();
doc.Save("newlocation.docx");

Hi there,

Thanks for sharing the detail. I have tested the scenario using following code example and have managed to reproduce the same issue at my side.

Document doc = new Document(MyDir + "SumFieldFixture-WithValues.docx");
doc.UpdateFields();
doc.Save(MyDir + "Out.docx");

For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-11059. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

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

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