Call Crystal Report from Application Engine

Before doing this, check the conditions below:

       1. Make sure Process Definition of the Crystal Report has been setup correctly.

       2. Make sure the Process Groups of AE also has permission to run the crystal report. Setup the same Process Groups for AE and Crystal Report should be a good idea.

       3. Make sure there is AET record for AE and added to its property. At least two fields in AET record: PROCESS_INSTANCE, RUN_CNTL_ID.

Referenced PeopleCode in Application Engine:

&PRCSTYPE = "Crystal";

&PRCSNAME = "TRC4110A";                                              -- Name of the Crystal Report

&RUNCNTLID = AE_CRYSTAL_AET.RUN_CNTL_ID;               --Fecth run control id from run control record

Local ProcessRequest &RQST;

Local Rowset &RS;

/* Create the ProcessRequest Object */

&RQST = CreateProcessRequest(&PRCSTYPE, &PRCSNAME); --Define Process Request

/* Set all the Required Properties */

&RQST.RunControlID = &RUNCNTLID;

&RQST.Schedule();                                                            --Call Crystal Report

 

If &RQST.Status = 0 Then                                                                                                           

   /* Schedule succeeded. */  

   &ProcInst = &RQST.ProcessInstance;  

   &RS = CreateRowset(Record.RUN_CNTLLDAP);  

   &RS.InsertRow(&RS.ActiveRowCount);  

   &RS(&RS.ActiveRowCount).RUN_CNTLLDAP.OPRID.Value = %UserId;

   &RS(&RS.ActiveRowCount).RUN_CNTLLDAP.PROCESS_INSTANCE.Value = &ProcInst;  

   &RS(&RS.ActiveRowCount).RUN_CNTLLDAP.RUN_CNTL_ID.Value = &RUNCNTLID;  

   &RS(&RS.ActiveRowCount).RUN_CNTLLDAP.LDAPMAPNAME.Value = "All";  

End-If;

Exit (1);

 

转载于:https://www.cnblogs.com/GoDevil/archive/2008/12/31/1366231.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值