This content has been marked as final. Show 4 replies
Take a look at the Report class:
import PSXP_REPORTMGR:Report; Local PSXP_REPORTMGR:Report &oRpt = create PSXP_REPORTMGR:Report(String(&nRptId), &prcsinstance, &contentid, &sdbname, &sRptName, &sRptDescr, &sRptURL, &sFileURL, &dRptCreateDttm, &dRptExpireDt, &sFldrName);
There are multiple ways of achieving your goal. The easiest would be to store a reference to the report before it is published the first time in a record. This record would then contain a process instance number which can then be used in the Report class to retrieve the report. If you want to search for reports through PeopleCode take a look here:
This is the same functionality which is used in the XML report search page.
Thanks for the reply Michel..
If i understood your reply correctly, you are saying that i should pass the process instance and pass in the process report() ???
And find the next process instance number available to use for XMLP report generation?
The process instance number gets populated automatically by PeopleSoft when calling Publish. The problem however is that you cannot retrieve the assigned process instance number through PeopleCode after calling Publish. I think this property has a use when running the report through the Process Scheduler and not the Application server (which is the case in this situation).
Take a look at the PSRF_RINFO_TBL record. In this record all the XMLP reports will be stored with the report URL. Your requirement says that when a user enters a component with a certain search criteria and a report was already generated for that criteria the link at level 1 should open that specific report. With the PSRF_RINFO_TBL record you know which reports have been generated so far. The only thing you then need is to link a report to a specific search criteria. If you run a SQLExec on the PSRF_RINFO_TBL after you've published it you should be able to retrieve the process instance and content id. If you add either a record or some fields to the existing record for that component you can link the process instance/contentid to the search criteria. If a report already exists you can use the code I've posted in my previous post to open the report on the screen.
Thanks Michel...This helps...I will try it out...