This chapter provides an overview of PostReport class and discusses the following topics:
Data type of a PostReport object
Scope of a PostReport object
Determining the distribution list
PostReport class built-in functions
PostReport class properties
PostReport examples
See Also
The PostReport class provides properties and method for posting reports to the Report Repository. This class enables you to create reports outside of Process Scheduler and have them posted in the Report Repository.
The request to post reports creates an entry to the Report Manager table. The Distribution Agent polls the Report Manager table for any new requests and proceeds with any request it finds by transferring the files to the repository server. The report can then be accessed from the Report Manager after the Distribution Agent successfully processes the post request.
See Also
Use the AddDistributionOption method to authorize users to view the report from the Report Manager. This function enables you to grant access to the report either specifying a User ID or Role. However, if no distribution list is specified in the request, the class queries the system for the distribution list as follows:
If the Process Instance is specified, the system checks for the distribution list in the Process Request table. The system assumes in this case that the request was scheduled through the Process Request Dialog, but was processed by a third-party scheduler.
If a Process Name and Process Type properties were specified, the system checks if a distribution list was predefined in the Process Definition table.
If no list was found using the above queries, the user who submitted the request has sole access to the report.
A PostReport object is declared using the PostReport data type. For example:
Local PostReport &POSTRQST;
A PostReport object can only be instantiated from PeopleCode. However, if you need to access the Process Schedule Manger from outside of PeopleCode, like in a Visual Basic program, you can use the Process Schedule Manager API.
This object can be used anywhere you have PeopleCode, that is, in an application class, Component Interface PeopleCode, record field PeopleCode, and so on.
See Also
Understanding PeopleSoft Process Scheduler
In this section, we discuss the PostReport class methods. The methods are discussed in alphabetical order.
Syntax
AddDistributionOption(DistIdType, DistId)
Description
Use the AddDistributionOption method to specify the users authorized to view the report once it is available in the Report Manager.
Parameters
DistIdType |
Specify the distribution ID type as a string. This identifies if the value passed in the DistID is either a user or role. Values for this parameter are:
|
DistID |
Specify the distribution ID as a string. |
Returns
Returns a number: 0 if successful, 1 if the system detected an error in the parameter passed.
Example
The following example grants access to the VP1 user and all users associated with the MANAGERS role.
&POSTRQST.AddDistributionOption("User", "QEDMO" ); &POSTRQST.AddDistributionOption("Role", "MANAGERS");
Syntax
Put()
Description
The Put method inserts a request in the Report Manager table which runs according to the values in the properties of the PostReport object. In order to successfully schedule a process or job, certain properties are required.
Parameters
None.
Returns
None. If you want to verify that the method executed successfully, check the value of the Status property.
Example
&POSTRQST.Put(); &RPTINSTANCE = &POSTRQST.ReportId; If (&RPTINSTANCE > 0) Then MessageBox(0, "", 63, 119, "Successfully processed request with Rpt. ID %1 for Process %2 to post from directory %3", &RPTINSTANCE, &POSTRQST.ProcessName, &POSTRQST.SourceReportPath); Else MessageBox(0, "", 63, 122, "Not successful for process request for Process %1 to post from directory %2", &POSTRQST.ProcessName, &POSTRQST.SourceReportPath); End-If;
See Also
In this section, we discuss the PostReport class properties. The properties are discussed in alphabetical order.
Description
This property specifies the date the report will be deleted from the Report Manager table. If the expiration date is not specified, the system calculates the expiration date based on the Retention Days specified in the Process Scheduler’s System Settings.
This property is read-write.
Example
&MYRQST.ExpirationDate = "2003/01/01";
See Also
Description
This property specifies the output format of the file that is posted to the Report Repository. If format is not specified, the system determines the format based on the extension of the file being posted to the Report Repository.
This property is read-write.
Example
&MYRQST.OutDestFormat = "PDF";
See Also
Values for Output Type and Format
Description
This property specifies the instance number assigned to request. This property is only required if the report was initially submitted through the Process Request Dialog, but was processed by a third-party scheduler.
This property is read-write.
See Also
Determining the Distribution List
Description
This property specifies the name of a predefined process as a string.
This property is read-write.
Example
&MYRQST.ProcessName = "XRFWIN";
See Also
Description
This property specifies the name of a predefined process type as a string.
This property is read-write.
Example
Note that spaces are included in the string for ProcessType.
&MYRQST.ProcessType = "Application Engine";
See Also
Description
This property specifies the description as a string.
If the ReportDescr property is not specified, and both Process Name and Process Type are not null, the description is extracted from the Process Definition table.
This property is read-write.
Example
&MYRQST.ReportDescr = "Panel Cross Reference Report";
Description
This property specifies the name of the report folder as a string. If you specify a folder, the folder that you specify must have already been defined using Process Scheduler’s Report Folders Administration.
This property is read-write.
See Also
Description
This property is a system-generated identification number. The system assigns a ReportId after the Put method processed the request.
This property is read-write.
Example
&MYRQST.Put(); if &MYRQST.ReportId = 0 then MessageBox(o, "", 63, 119, "Sucessfully processed request with Rpt. ID %1", &MYRQST.ReportId); Else /* do error processing */ End-If;
Description
This property specifies the Process Scheduler Server name that posts the report. This property takes a string value.
This property is read-write.
Example
&MYRQST.ServerName = "PSNT";
See Also
Description
This property specifies the path that contains the source report. You need to specify an absolute path.
This property is read-write.
The following example posts files found in the directory ‘c:\temp\SQRDIR’ and can be accessed by VP1 and users in the MANAGERS role.
Local PostReport &RPTINFO; Local number &RPTINSTANCE /*********************************************************************** * Construct a PostReport Object. * ***********************************************************************/ &RPTINFO = SetPostReport(); &RPTINFO.ProcessName = "GLS7009"; &RPTINFO.ProcessType = "SQR Report"; &RPTINFO.ReportFolder = "Financial"; &RPTINFO.SourceReportPath = "c:\temp\SQRDIR"; &RPTINFO.ExpirationDate = "2005/01/01"; &RPTINFO.ReportDescr = "Journal Posting Summary Report"; &RPTINFO.ServerName = "PSNT"; &RPTINFO.AddDistributionOption("USER", "VP1"); &RPTINFO.AddDistributionOption("ROLE", "MANAGERS"); &RPTINFO.Put(); &RPTINSTANCE = &RPTINFO.ReportId; If (&RPTINSTANCE > 0) Then MessageBox(0, "", 63, 119, "Successfully processed request with Rpt. ID %1 for Process %2 to post from directory %3", &RPTINSTANCE, &RPTINFO.ProcessName, &RPTINFO.SourceReportPath); Else MessageBox(0, "", 63, 122, "Not successful for process request for Process %1 to post from directory %2", &RPTINFO.ProcessName, &RPTINFO.SourceReportPath); End-If;