Using PS/nVision API Functions

PS/nVision has an API function interface. The Excel macros that you write can use these functions to gain access to PS/nVision features.

Note: In Microsoft Excel, there are two macro programming languages: Microsoft Visual Basic for Applications (VBA) and the Microsoft Excel 4.0 macro language. VBA is recommended over Excel 4.0 macros because VBA is more flexible and more powerful than the Excel 4.0 macros. In addition, Visual Basic may be the only programming language offered in future versions of Microsoft Excel. The following API functions can only be invoked from Microsoft Excel 4.0 macros.

To use nVision functions from VBA, see Using Designer Object Methods, Designer Object Methods, Using Session Object Methods, Session Object Methods, Instance Hooks.

The following table lists and describes the API functions, which may not be run within a macro called via NvsInstanceHook.

Interface Function

Purpose

Arguments

Example

NvsAutoDrill

Performs an AutoDrill, similar to selecting the AutoDrill menu item. AutoDrill is only usable in reports based on queries, and in ledger-based reports for which the NvsDefaultDrill name is defined in the layout, specifying the name of the layout to run as an AutoDrill.

None

=NvsAutoDrill()

NvsDrillDown

Start a matrix DrillDown. Similar to using the DrillDown item on the nVision menu. The user selects a DrillDown layout from the Open dialog box.

None

=NvsDrillDown()

NvsDrillLayout

Run a matrix DrillDown using a specified layout.

Layout name

=NvsDrillLayout("ACTPER.XNV")

NvsDrillQuery

Run a tabular DrillDown using a specified query.

Query name

=NvsDrillQuery("Journals")

NvsJumpBack

Return to the sheet and cell from which the current sheet drilled down (same as the Jump Back command).

None

=NvsJumpBack()

NvsLayoutDefn

Show the PeopleSoft nVision Layout Definition dialog box for the selected row, column, or cell. This is the equivalent of the nVision > Layout Definition menu item.

None

=NvsLayoutDefn()

NvsNewLayout

Create a new layout. Similar to using the nVision > New Layout menu item.

None

=NvsNewLayout()

NvsOnWindow

Activate PS/nVision menus for the current window. This activation is required when your macro opens a sheet, since Microsoft Excel does not signal PS/nVision that the new sheet has been activated.

None

=NvsOnWindow()

NvsOpenFile

Open a Microsoft Excel worksheet, waiting if necessary in case another user on the network is accessing the file. If the file opens successfully, call NvsOnWindow to update menus. Optional arguments say whether to update links to other documents and if file is to be opened read-only.

filespec, updlinks, read-only

=NvsOpenFile ("FSDEMO.XLS", TRUE, FALSE)

NvsOpenLayout

Open a layout. Similar to using the nVision > Open Layout menu item.

None

=NvsOpenLayout()

NvsOpenReport

Open a report request. Similar to clicking the Open button in the PeopleSoft nVision Report Request dialog box.

None

=NvsOpenReport()

NvsOpenScope

Open an existing scope definition. Similar to clicking the Open button in the PeopleSoft nVision Scope Definition dialog box.

None

=NvsOpenScope()

NvsReDrill

Repeat the most recent DrillDown from the currently selected amount cell.

None

=NvsReDrill()

NvsReport Request

Display the PeopleSoft nVision Report Request dialog box. This activation is similar, to the nVision > Report Request menu item.

None

=NvsReportRequest()

NvsRunCurrent

Runs the current report. This activation is similar to the nVision > Run Current Report menu item.

None

=NvsRunCurrent()

NvsRunQuery

Run a specified query, without inheriting DrillDown criteria.

Query name

=NvsRunQuery ("AP Journals")

NvsRunReport

When used without a parameter, prompts the user to select a report to run, and then runs the selected report. With a parameter, runs a specified matrix report, without showing the report key dialog or Report Request.

Business Unit, Report ID

=NvsRunReport() ("M04","ISDEMO")

NvsSaveAsLayout

Prompt user to save the layout with a new name. This activation is similar to using the nVision > Save As Layout menu item.

None

=NvsSaveAsLayout()

NvsScopeDefn

Open the PeopleSoft nVision Scope Definition dialog box. This activation is similar to using the nVision > Scope Definition menu item.

None

=NvsScopeDefn()

This table lists the nVision command line parameters and their corresponding fields in the Define Report Request page.

Parameter

Corresponding Field

NRN

Report ID

NBU

Business Unit

NLN

Layout

NRT

Report Title

NSN

Report Scope

NDT

Directory Template

NFT

File Template

NLT

Language

NET

Email Template

NDET

Content Description Template

NAT

Security Template

NPF

Folder Name

NTM

Time-out Minutes

NRET

Retention Days

NRB

Data From Requesting B.U. Only

NEN

Enable nPlosion If Specified In Layout

NTL

Translate Summary Ledgers to Detail

NADO

As Of Reporting Date

NTDO

Tree As Of Date

NASD

As of Reporting Date (for specify option)

NTED

Tree As Of Date (for specify option)

NHL

Note: This parameter is the generated hyper link.

NDL

Note: This parameter indicates whether the output options are overridden on the Process Scheduler Request page.

This example shows the nVision command line parameters used in the Define Report Request page:

PSNVS.EXE -CTORACLE -CDT853IB02 -COVP1 -CP%OPRPSWD% -R" " -I10502 -OT6 -OF8 -OPDistribution List -NRNFSDETAIL -NBUUS001 -NHLhttp://qt-ibm12.us.oracle.com:17320/psp/t853ib02x_newwin/EMPLOYEE/QE_IBTGT/c/REPORT_BOOKS.IC_RUN_DRILLDOWN.GBL?Action=A -NDL0 -NLN"FSDETAIL" -NRT"Detailed Financial Statement" -NSNDEPTID -NRBY -NENY -NTLY -NADOU -NASD1999-12-31 -NTDOR -NTED -NDT"C:\TEMP" -NFT"%RID%.XLS" -NLTDUT -NETnvs@peoplesoft.com -NDET"%RTT%" -NATU:VP1 -NPFGENERAL -NOT6 -NOF8 -NTM10 -NRET2