PeopleCode启动SQR程序

来源:互联网 发布:上海淘宝美工兼职工资 编辑:程序博客网 时间:2024/06/16 14:22

参考1:

  1. &PROCESS_NAME = "SQRNAME"; 
  2. &PROCESS_TYPE = "SQR Report"; 
  3. &RUN_CNTL_ID = "YOUR_RUN_ID"; 
  4. &RUN_CONTROL = ScheduleProcess(&PROCESS_TYPE, &PROCESS_NAME, "2", &RUN_CNTL_ID, &PRCS_INST); 
  5. REM |+-------------------------------+|; 
  6. REM  "1" = client  , "2" = server ; 
  7. REM |+-------------------------------+|; 
  8. If &RC != 0 
  9. Winmessage("Error: Error Scheduling SQR Process, RC ="/&RUN_CONTROL); 
  10. End-If; 

 

参考2:

SQR 本身是一门技术,通常可用来做一些batchjob或者是生成报表,而在peoplesoft中,SQR的用处也很大很灵活。在PeopleSoft中,通常有2种方式来执行一个      SQR, 比较常用的方法是Process Scheduler,同时,我们也可以使用Peoplecode直接调用一个SQR文件。

下面我们具体来谈谈如果使用peoplecode调用一个SQR文件。

设计好相应的页面后,在为按钮添加peoplecode,

Local ProcessRequest &RQST; //定义与个processrequest实例

/* Create the ProcessRequest Object */

&RQST = CreateProcessRequest();

/* Set all the Required Properties */

&RQST.RunControlID = RunControlTable.RUN_CNTL_ID;// 这里就是你的run control table里面的run control id,此项为必须的。

&RQST.ProcessType = "SQR Process"; //类型

&RQST.ProcessName = "MySqr";//定义需要执行的SQR名字

/* Set any Optional Properties for this Process */ 以下这些是可选项,诸如Email之类的,可根据需要添加。

&RQST.RunLocation = &sRunLocation;

&RQST.RunDateTime = &dttmRunDateTime;

&RQST.TimeZone = &sTimeZone;

&RQST.PortalFolder = &sPortalFolder;

&RQST.RunRecurrence = &sRecurrence;

&RQST.OutDestType = &sOutDestType;

&RQST.OutDestFormat = &sOutDestFormat;

&RQST.OutDest = &sOutputDirectory;

&RQST.EmailAttachLog = &bEmailAttachLog;

&RQST.EmailWebReport = &bEmailWebReport;

&RQST.EmailSubject = &sEmailSubject;

&RQST.EmailText = &sEmailText;

&RQST.Schedule(); //加入到schedule中,执行sqr。

不管是通过Process Scheduler还是直接使用peoplecode调用,SQR的执行与写法都是一样的,无需做任何修改。

原创粉丝点击