Hi,
We would like the number merged from data source to be non-negative as per data format that we specify:
{ MERGEFIELD “DocDescription” #,###.00 }
but it displays as negative. Please find the code sample below and the template attached.
var dataFile =
new XDocument(new XElement("Data", new XElement("PrimaryRecordSet", new XAttribute("ID", "Main"),
new XElement("DocDescription", "-1,057.25"))));
var mergeData = createDummyMergeData(dataFile);
var document = new Document(@"Merge_Number_Switch_Format_337964.dotx");
document.MailMerge.Execute(mergeData);
document.MailMerge.ExecuteWithRegions(mergeData);
document.UpdateFields();
document.Save("OutputFiles/Output.docx");
Template: Merge_Number_Switch_Format_337964.zip (18.3 KB)
Could you please take a look?
Thanks,
Ewa