Using nVision Run API

To run specific nVision reports from an application page, you have the option to use nVision Run API on a button or hyper link instead of navigating through multiple nVision pages under Reporting Tools (Reporting Tools, and then PS/nVision, and then PS/nVision Schedule Requests).

The API can be applied on a page control, such as, a button or hyper link, by passing Report ID and Business Unit values. This API abstracts the nVision Run method so that data is secure.

Verifying User Permission

The user permission to run a report is verified by the nVision_IsAuthorised API. Based on the permission, the page control such as, button or hyperlink, is enabled or disabled. If an unauthorized user tries to run this report, an authentication failed error message appears.

The following example, where Business Unit is US001 and Report ID is FSDETAIL, shows the syntax and application package details of nVision_RunReport and nVision_IsAuthorised APIs.

import PT_NVISIONPKG:nvision_Runreport;

import PT_NVISIONPKG:nVision_IsAuthorised;

Local boolean &ret;

ComponentLife PT_NVISIONPKG:nvision_Runreport &nVis;

ComponentLife PT_NVISIONPKG:nVision_IsAuthorised &nVis1;

&nVis1 = create PT_NVISIONPKG:nVision_IsAuthorised();

&nVis = create PT_NVISIONPKG:nvision_Runreport();

&ret = &nVis1.nVisionIsAuthorised("US001", "FSDETAIL");

If &ret = True Then

   &nVis.nvis_Run("US001", "FSDETAIL");

End-If;

Note:

To run the report, you must apply the nVision_RunReport and nVision_IsAuthorised APIs on the page control.