ReportDefn Class Methods
In this section, the ReportDefn class methods are presented in alphabetical order.
Syntax
Close()
Description
Use this method when there is an exception or error calling the ProcessReport method or any other output method (Publish, PrintOutout or DisplayOutput) of the ReportDefn class. Calling this method cleans up all temporary files, folders, and resources.
Parameters
None.
Returns
None.
Syntax
DisplayOutput()
Description
Use the DisplayOutput method to display the report generated by the ProcessReport method in a separate browser window.
You must successfully call the ProcessReport method prior to calling this method.
This method displays a single report. Therefore, the report definition must not be set for bursting.
Parameters
None.
Returns
None.
Syntax
EmailOutput(ProcessInstanceID)
Description
Use the EmailOutput method to send an email of the report generated by the ProcessReport method. This method can be used for bursted and non-bursted reports. You must successfully call the ProcessReport method prior to calling this method.
The report is distributed as an email attachment to the report viewers defined in the report definition, to users defined by the Distribution link during run-time report scheduling, or to external users when the IPT_BIP_EXT_EMAIL_INT:BIP_EMAIL_DATA interface class is implemented.
Parameters
Field or Control |
Definition |
---|---|
ProcessInstanceID |
Specify the process instance of the calling process, such as the calling Application Engine program. Note: Invoking this method with a process instance ID of 0 is invalid; the EmailOutput method can only be used for scheduled reports. |
Returns
A Boolean value: True if the report was sent (email) successfully; otherwise, False.
Syntax
Get()
Description
Use the Get method to return a reference to the existing ReportDefn object.
Parameters
None.
Returns
A reference to the newly instantiated and populated ReportDefn object.
Syntax
GetOutDestFormatString(OutDestFormat)
Description
Use the GetOutDestFormatString method to convert the output format returned from system variable %OutDestFormat to a BI Publisher output format string that can be passed to the output type parameter of the ProcessReport method. This method is useful when processing reports generated by application engine programs that are run process scheduler.
Parameters
Field or Control |
Definition |
---|---|
OutDestFormat |
Specify the output destination format as a number. If you specify something other than a valid value, the method throws an exception. Valid values are: |
Value |
Description |
---|---|
2 |
PDF format |
5 |
HTM format |
8 |
XLS format |
12 |
RTF format |
Returns
A string if successful. Valid values are:
PDF
HTM
XLS
RTF
Syntax
GetPSQueryPromptRecord()
Description
Use the GetPSQueryPromptRecord method to return the runtime prompts of a query as a record object. This method should only be used when the data source type associated with the report definition is a PeopleSoft query or a Composite Query. This method returns a null when the data source type isn't a PeopleSoft Query or a Composite Query.
Parameters
None.
Returns
A record object populated with the query prompts if the data source definition is a PeopleSoft query or a Composite Query, null otherwise.
Syntax
PrintOutput(DestPrinter)
Description
Use the PrintOutput method to print the report definition object executing the method. The ProcessReport method must be called successfully before you use this method.
Note: If you don’t set the printer type with the SetPrinterType method before invoking PrintOutput, the default value of PDF is used.
Parameters
Field or Control |
Definition |
---|---|
DestPrinter |
Specify the printer you want to use for printing the report, as a String. |
Returns
None.
Syntax
ProcessReport(TemplateId, LanguageCD, AsOfDate, OutputFormat)
Description
Use the ProcessReport method to generate a report and store the information.
Before you generate the report, you must:
Set the report output destination with the OutDestination property if the output type is a file.
Specify the data source using the SetRuntimeDataXMLFile method if you are using a data source other than a PeopleSoft query.
After you use the ProcessReport method, you can use the Publish method to post the report, the DisplayOutput method to display the report in a browser window, or the PrintOutput method to print the report.
Parameters
Field or Control |
Definition |
---|---|
TemplateId |
Specify the template to be used for processing this report, as a string. You can specify a null value for this parameter, that is, (""). When you specify a null value, the default template associated with the report definition is used. |
LanguageCD |
Specify the three-letter language code for the report definition, such as ENG, FRA, ESP and so on. This parameter controls both the translation and the language specific output details such as font selection and right-to-left page orientation for Arabic/Hebrew. You can specify a null value for this parameter, that is, (""). If you specify a null value, the current language of the session is used. |
AsOfDate |
Specify the as of date for the report, as a date. |
OutputFormat |
Specify the output format, as a string. You can specify a null value for this parameter, that is, (""). When you specify a null value, the default output format associated with the report definition is used. |
Returns
None.
Syntax
Publish(ServerName, ReportPath, FolderName, ProcessInstanceID)
Description
Use the Publish method to publish the current report definition
You must have successfully completed a call to the ProcessReport method before you can use this method.
The Publish method was intended to be used primarily for reports running on the Process Scheduler server, but can also be used when running the report on the application server as well. In the latter case, even though the report is run on the application server, the report distribution must occur on an active Process Scheduler server that is configured with a running Distribution Agent service and a properly configured report node.
When the Publish method is called while running a report using the Process Scheduler server, the ServerName parameter must be specified as a blank string (""), and the ProcessInstanceID parameter must be set to the process instance of the calling process.
When the Publish is called while running a report on the application server, the ServerName parameter must be specified with an active Process Scheduler server that will post the report. The specified server must also have access to the report output destination folder in order to successfully post the report. If the application server and the Process Scheduler server share the same physical host machine, this will not be a concern. If not, you may specify an alternate output destination folder for the report (for example, a network share location) using the report definition’s OutDestination property to ensure that the Process Scheduler server is able to access it for posting the report.
Parameters
Field or Control |
Definition |
---|---|
ServerName |
Specify the server to use for publishing the report, as a string. You can specify a null value for this parameter—that is, (""). |
ReportPath |
Always specify a null value only for this parameter—that is, (""). |
FolderName |
Specify the name of the report folder that the report should be posted to. You can specify a null value for this parameter—that is, (""). If you do not provide a value for this parameter, the default folder is used to post reports. |
ProcessInstanceID |
Specify the process instance of the calling process, such as the calling Application Engine program. If you specify a 0, a new process instance is generated to track the report posting process. |
Returns
None.
Syntax
setPDFConversionFiles(&inputFiles)
Description
Use the setPDFConversionFiles method to specify the paths to external documents to be converted to PDF and merged with the main report. You must call this method before invoking the ProcessReport method.
BI Publisher for PeopleSoft enables you to include attachments from external sources with a PDF report. The source attachments are converted to PDF format and then merged with the main report. The report is then displayed to the end users or delivered to Report Manager.
Parameters
Field or Control |
Definition |
---|---|
&inputFiles |
Specify an already instantiated array of String representing the paths to the external documents to include in the report as PDF files. |
Returns
None.
Example
Local number &oitTimeOut = 15;
&oRptDefn.setPDFConversionFiles(&inputFiles);
&oRptDefn.setPDFConversionTimeOut(&oitTimeOut);
Syntax
setPDFConversionPageNumbering(x_pos, y_pos)
Description
Use the setPDFConversionPageNumbering method to specify the position of the page numbering across merged attachments and the main report. If this method is not invoked, no page numbers will be added to the pages in the report.
Note: Double page numbering will occur if you invoke this method when the report itself or any of the attachments include their own internal page numbering.
You must use this method before using the ProcessReport method.
Parameters
Field or Control |
Definition |
---|---|
x_pos |
Specify an integer value representing the position in 72 dpi pixels from the left edge of the page. |
y_pos |
Specify an integer value representing the position in 72 dpi pixels from the bottom edge of the page. |
Returns
None.
Example
&oRptDefn.setPDFConversionPageNumbering(550, 15);
Syntax
setPDFConversionTimeOut(seconds)
Description
Use the setPDFConversionTimeOut method to specify a timeout interval for PDF conversion for this report that overrides the value of the psxp_pdfconversion_timeout global property.
You must use this method before using the ProcessReport method.
Parameters
Field or Control |
Definition |
---|---|
seconds |
Specify a Number value representing the timeout interval in seconds. |
Returns
None.
Example
Local number &oitTimeOut = 15;
&oRptDefn.setPDFConversionFiles(&inputFiles);
&oRptDefn.setPDFConversionTimeOut(&oitTimeOut);
Syntax
SetPrinterType(OutDestFormat)
Description
Use the SetPrinterType method to set the printer type when using the PrintOutput method. If you don’t set the printer type before invoking PrintOutput, the default value of PDF is used.
Parameters
Field or Control |
Definition |
---|---|
OutDestFormat |
Specify the printer type as a String value:
|
Returns
None.
Syntax
SetPSQueryPromptRecord(&Record)
Description
Use the SetPSQueryPromptRecord method to specify an already instantiated record object that contains the prompt values for the query to be used to populate the report.
This method can only be used with reports that have a PeopleSoft query or a Composite Query defined as the data source.
You must use this method before using the ProcessReport method.
Parameters
Field or Control |
Definition |
---|---|
&Record |
Specify an already instantiated and populated record object that contains the values for the query to be used to populate the report. |
Returns
None.
Syntax
SetRuntimeDataXMLFile(FilePath)
Description
Use the SetRuntimeDataXMLFile method to specify an existing XML file as the data source for the report.
Note: Because the SetRuntimeDataRowset and SetRuntimeDataXMLDoc methods have been deprecated, use this SetRuntimeDataXMLFile method instead.
Report definitions that use a data source other than a PeopleSoft query must set that data source before generating the report using the ProcessReport method.
Forward or back slashes are used in the path according to the operating system of the application server or process scheduler server—that is, on Unix servers, the directory separator is a forward slash, while Windows servers use back slashes.
Parameters
Field or Control |
Definition |
---|---|
FilePath |
Specify an absolute path to the file that you want to use. You must include the file name and file extension in the parameter. Forward or back slashes are used in the path according to the operating system of the application server or process scheduler server. That is, on Unix servers, the directory separator is a forward slash, while a Windows server use a path with back slashes. |
Returns
None.
Syntax
SetRuntimeProperties(&NameArray, &ValueArray)
Description
Use the SetRuntimeProperties method to set additional runtime values and properties required for generating this report.
Note: BI Publisher's properties are defined at three different levels. Global properties are defined on the Global Properties page, and system properties are defined in the xdo.cfg file. At the report definition level, properties are defined on the Report Definition - Properties page. The runtime properties defined using this method override both global and report definition properties. However, system properties defined in the xdo.cfg file cannot be overridden using this method.
Parameters
Field or Control |
Definition |
---|---|
&NameArray |
Specify an already instantiated and populated array of string containing the names of the additional properties or variables that you need for this report. |
&ValueArray |
Specify an already instantiated and populated array of string containing the values of the additional properties or variables that you need for this report. The values should be in the same order as the names listed in &NameArray. |
Returns
None.
Example
The following example sets extra parameters for securing a document.
&asPropName = CreateArrayRept("", 0);
&asPropValue = CreateArrayRept("", 0);
&asPropName.Push("pdf-compression");
&asPropValue.Push("false");
&asPropName.Push("pdf-hide-menubar");
&asPropValue.Push("true");
&oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);
Setting Custom Runtime Parameters
The SetRuntimeProperties method can also be used to set custom runtime parameters. When setting custom runtime parameters with the SetRuntimeProperties method, the parameter names need to be prefixed with xslt, and the values need to be surrounded by single quotes (for example, 'xyz'). For example, the following code creates a custom runtime parameter named xslt.ReportOwner:
&asPropName = CreateArrayRept("", 0);
&asPropValue = CreateArrayRept("", 0);
&asPropName.Push("xslt.ReportOwner");
/* Note the single quotes around the parameter value */
&asPropValue.Push(" 'John Smith' ");
&oRptDefn.SetRuntimeProperties(&asPropName, &asPropValue);
The custom parameter may now be used in the template via the tag <?$ReportOwner?>. Before using it, it does need to be declared in a form field on the report template using the following tag:
<xsl:param name="ReportOwner" xdofo:ctx="begin"/>