- 2 Posts
- 39 Views
Printing output from a custom page using PeopleCode
What is the best way to print a custom page using PeopleCode? We are currently simply printing the webpage, but that creates issues with spacing and page breaks. Is there another way to do that in the PeopleCode where you can better control the printed output?
Hi@Brian-Mullennix
The BI Publisher classes enable you to access the runtime portions of the BI publishing process programmatically, that is, after the templates and reports have been created. The BI Publisher classes are not built-in classes, like rowset, field, record, and so on. They are application classes. Before you can use these classes in your PeopleCode program, you must import them to your program.
Your import statements should look like this:
import PSXP_RPTDEFNMANAGER:*;
See ReportDefn Class Constructor.
Example: Publish a Report Based on PS Query
This is a code snippet example for publishing a report based on PS Query:
import PSXP_RPTDEFNMANAGER:*;
/* get report definition object /
&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn (&sRptDefn);
&oRptDefn.Get();
/ fill query runtime prompt record */
&rcdQryPrompts = &oRptDefn.GetPSQueryPromptRecord();
If Not &rcdQryPrompts = Null Then
&oRptDefn.SetPSQueryPromptRecord(&rcdQryPrompts);
End-If;
/generate report/
&oRptDefn.ProcessReport (&sTmpltID, &sLangCd, &AsOfDate, &sOutFormat);
/*publish report */
&oRptDefn.Publish(&sPrcsServerName,"",&sFolder, &prcsInstId);
Example: Print a Report Based on XMLFile
This is a code snippet example for printing a report based on XMLFile:
import PSXP_RPTDEFNMANAGER:*;
/* get report definition object /
&oRptDefn = create PSXP_RPTDEFNMANAGER:ReportDefn (&sRptDefn);
&oRptDefn.Get();
/ pass XMLFile to the report definition */
&oRptDefn.SetRuntimeDataXMLFile(&sXMLFilePath);
/generate report/
&oRptDefn.ProcessReport (&sTmpltID, &sLangCd, &AsOfDate, &sOutFormat);
/*print report */
&oRptDefn.PrintOutput(&sDestinationPath);
Click Here to learn PeopleSoft HRMS Training
Thanks in Advance
Lavanya Sreepada