Resolving "DTD is Prohibited in This XML Document" Error in Telerik Reporting
Environment
Product | Reporting |
Version | Any |
Description
I encounter an XmlException: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method
error while attempting to render a report from a .trdx
file using Telerik Reporting.
Cause
The error occurs because the internal XML parser in Telerik Reporting disables DTD processing to mitigate potential security vulnerabilities, such as XML External Entity (XXE) attacks. Attacks of this kind can lead to denial of service or other exploits.
Report definition files created by the Standalone Report Designer or the Web Report Designer typically do not include any DTD rules. If DTD processing is required, it may indicate that the file's XML content has been modified.
Another potential cause is incorrectly serving the .trdx
file from a URI. If the server alters the XML content, this can trigger the error.
Solution
To resolve the issue, follow these steps:
-
Use a File System Path - Replace the report source with a file path pointing directly to the
.trdx
file stored locally. This ensures that the XML content is not modified during file serving. -
Provide the Report for Investigation - If the problem persists, consider opening a support ticket via the Technical Support Center and provide the problematic
.trdx
file for further investigation.