Failed to Generate or Read Data Source XML
While developing an XML publisher report, I was receiving the following error:
Failed to generate or read Data Source XML file (235,2305)
PSXP_RPTDEFNMANAGER.ReportDefn.OnExecute
Name:ProcessReport PCPC:44256 Statement:1039
The code involved setting the run time data XML file using the following line:
&report_defn.SetRuntimeDataXMLFile(&path_to_xml_file);
Before calling ProcessRepor
t. This didn't seem to work, however changing the code to read an XML file on the application server, creating an XMLDoc
object out of the contents of the file and using SetRuntimeDataXMLDoc
did the trick. Basically code like this (note only relevant code is shown):
/* Read the contents of the XML data file */
&xml_file = GetFile(&xml_data_file_path, "R", %FilePath_Absolute);
While &xml_file.ReadLine(&xml_data_line)
&xml_data = &xml_data | &xml_data_line;
End-While;
/* Create XMLDoc object from file */
&xml_doc = CreateXmlDoc(&xml_data);
/* Set runtime data XML document */
...
&report_defn.SetRuntimeDataXMLDoc(&xml_doc);
...
No Comments