将SQR生成的文件发布到Report Manger的方法

来源:http://peoplesoft.wikidot.com/sqr-output-to-report-repository

If you are developing a new SQR that creates files that need to be posted from the process scheduler to the report repository, (report manager), here are the steps for doing this. Note this uses delivered SQCs.

The delivered getlogou.sqc can be used to post files to the report repository. There are two functions in this SQC:

  • get-prcsoutputdir which is used to get the original output destination from the PSPRCSPARMS record
  • get-logoutputdir-value which is used to get the process output directory from the PSPRCSPARMS record

Both functions require a global variable, #prcs_process_instance to be declared somewhere in your SQR. This is normaly the case if you call stdapi.sqc.

The orignal output destination is what has been entered into the process definition for the output location. This is normally %%Log/Output Directory%%. The process output directory is the expanded application server path to the log output directory.

The log output directory contains folders that are posted to the report repository. The naming convention for these folders is:

ProcessType_ProcessName_ProcessInstance

For example, CCLTRGEN is an SQR process. If the process instance is 1234567 then folder for this process in the log output directory would be:

SQR_CCLTRGEN_1234567

This folder typically contains log files (.log, .out), any of the common files output by the process (e.g. .pdf) and any files specifically created and placed in this directory.

This is a typical example of how you would use the get-logoutputdir-value procedure to determine the output location for a CSV file generated by your SQR:

do Get-logoutputdir-value ! getlogou.sqc
if (rtrim($prcsoutputdir,' ') <> '')
    move $prcsoutputdir to $CSVPath
end-if

You can check the process output location using the following SQL if you know the process instance:

select PRCSOUTPUTDIR
from PSPRCSPARMS 
where PRCSINSTANCE = '123456789'




!*********************************************************
!  GETLOGOU:  Get Current Log/Output Directory           *
!*********************************************************
!***********************************************************************
!                                                                      *
!               Confidentiality Information:                           *
!                                                                      *
!                                                                      *
! This module contains confidential and proprietary information        *
! of Oracle; it is not to be copied, reproduced, or transmitted        *
! in any form, by any means, in whole or in part, nor is it to         *
! be used for any purpose other than that for which it is              *
! expressly provided under the applicable license agreement.           *
!                                                                      *
! Copyright (C) 2006 Oracle. All Rights Reserved.                      *
!                                                                      *
!***********************************************************************
!***********************************************************************
!***********************************************************************
!                                                                      *
!          $Date:  2006/07/19:13:08:20                                 !
!       $Release:  HR9                                                 !
!      $Revision:  101                                                 !
!                                                                      *
!***********************************************************************
!
begin-procedure Get-prcsoutputdir


  let $origoutdest = ''
  let $prcsoutputdir = ''


begin-select


ORIGOUTDEST
   LET $origoutdest = &ORIGOUTDEST


FROM PSPRCSPARMS
WHERE PRCSINSTANCE = #prcs_process_instance
end-select


  if rtrim($origoutdest,' ') = '%%Log/Output Directory%%'


    let #prcs_process_instance = $prcs_process_instance


    do get-logoutputdir-value


  end-if


end-procedure


begin-procedure get-logoutputdir-value


begin-select


PRCSOUTPUTDIR


  let $prcsoutputdir = rtrim(&PRCSOUTPUTDIR, ' ')
  let $slash = '/'


  if $sqr-platform = 'WINDOWS-NT'
     let $slash = '\'
  end-if


  let #xlength = length($prcsoutputdir)
  if substr($prcsoutputdir,#xlength,1) = $slash
  else
    let $prcsoutputdir= rtrim($prcsoutputdir, ' ') || $slash
  end-if


FROM PSPRCSPARMS
WHERE PRCSINSTANCE = #prcs_process_instance
end-select


end-procedure






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值