I am using Oracle APEX version 5.1 and users are trying to print out BI reports from Oracle APEX. Currently, we are making use of "APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT" (Signature 4) to print the data present in APEX page on to a BI report.
Everything works fine until program encounters "&" or "<" or ">" in the XML tags. When "XML BI report" or "APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT" (I mentioned both because I don't know where the issue is occurring) encounters these characters the report comes out as blank. If the above mentioned characters are manually removed from the XML tags, BI report works fine and it gets printed out.
Steps to reproduce: 1) create XML data as given in the sample below. See the "&" in the "GMRISKMITIGATION" XML tag (you can replace this "&" with "<" or ">" and you will get the same result)
<?xml version="1.0"?>
<ROWSET>
<ROW>
<ID>1234</ID>
<ADDITIONAL_COMMENTS>New "test" front test test test test test test.</ADDITIONAL_COMMENTS>
<GMRISKMITIGATION> test test test test & test.</GMRISKMITIGATION>
</ROW>
</ROWSET>
2) Now you have the data, then using the routine given below from a "Button" in APEX page to download a BI report.
APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT (p_file_name => 'myreport',p_content_disposition => 'attachment', p_report_data => l_clob, /* XML data in clob format */ p_report_layout => l_file_as_clob,p_report_layout_type => 'rtf',
p_document_format => 'rtf');
3) Now if you press the button the BI report will be downloaded successfully but it will be empty.
"""
in the XML.]<COMMENTS>New "test" test.</COMMENTS> <GMR> test & test</GMR>
Quotes was working fine even if XML had quote symbol in the content, it also worked for apostrophe previously it was ' but when I replaced it with the actual apostrophe symbol it worked. What I have observed is when it encounters "&" it can be either " or & its unable to translate back to its symbols. – Ashlesh Kumar