Free Support Forum - aspose.com

DataSet removes special characters

I’m using mail merge to export data to word. I’m having a problem with the DataSet which removes the special characters in my Time column. Is there another way to execute the doc.MailMerge.ExecuteWithRegions(ds); line of code.
Here is my code:

DataSet ds = new DataSet();
da.Fill(ds, “dt”); //The problem is here

string fileName = “LastClockTimeReport.docx”;
Document doc = new Document(fileName);

doc.MailMerge.Execute(fieldNames, fieldValues);

doc.MailMerge.TrimWhitespaces = false;
doc.MailMerge.ExecuteWithRegions(ds);

When the fill method runs it removes the special characters from the Time column

@Johnane,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Good Day
I’ve manage to solve the problem.
Thanks

@Johnane,

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.