PostReport Class Examples
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;