当先锋百科网

首页 1 2 3 4 5 6 7
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;

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

&RQST.RunControlID = &RUNCNTLID;

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

 

If &RQST.Status = 0 Then                                                                                                           

     

   &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