How to handle invalid characters when printing Docentric template report

Error: Data Source Package XML has invalid format

When filling out information on the D365FO UI by copying info from external documents (for example Word documents), it’s possible that some of the invisible invalid characters will be copied over as well.

These characters are the first 32 characters of the ASCII table and are called control characters.

When trying to print a document that contains such characters to a Docentric print destination, the document generation will fail, because such characters are illegal in XML v1.0 which the Docentric engine uses in the background.

The error message is similar to the following:

Data Source Package XML has invalid format. 
Details: '', hexadecimal value 0x0B, is an invalid character. 
Line 1, position 41143.

Starting with Docentric version 3.4.7, there’s now a feature to handle such characters when printing Docentric template reports.

You can find the new ASCII control characters handling feature in the Docentric AX workspace → Docentric AX Reports → Action pane Data source → Generation options → General:

This is configurable by report and has three possible options:

  • the No action option, if you want no action to be taken for ASCII control characters.
  • the Removing option, if you want to skip the ASCII control characters in the report’s DDSP and avoid runtime error during document generation.
  • the Escaping option, if you want to temporarily print each ASCII control character in the report’s DDSP as the character ‘☐’ (U+2610), to be able to cleanse your source data.