Local CUSTOM_APPPKG &objReportData;
Local File &XMLFile;
Local string &XMLFilename;
Local PSXP_RPTDEFNMANAGER:ReportDefn &report;

&XMLFilename = “/tmp/InputFileName.xml”;

&XMLFile = GetFile(&XMLFilename, “W”, %FilePath_Absolute);

&objReportData = CreateObject(“CUSTOM_APPPKG”);

/*This will assign input parameters, for example StartDate and End Date*/
&objReportData.DS_WK_START_DT = &WK_START_DT;
&objReportData.DS_WK_END_DT = &WK_END_DT;

/*This will form the XML File*/
&objReportData.buildResponse();

&XMLFile.WriteLine(&objReportData.ResponseXml.GenXmlString());
&XMLFile.Close();

&report = create PSXP_RPTDEFNMANAGER:ReportDefn(“ReportID”);
&report.Get();
&report.SetRuntimeDataXMLFile(&XMLFilename);
&report.ProcessReport(“TemplateName”, “ENG”, %Date, “PDF”);
CommitWork();

&report.DisplayOutput();

Advertisements