Available Actions

When an event is received, it can trigger zero or more actions. The available actions are:

Maximize Action

The maximize action controls the maximized state of a named view. There are three types of action possible: Maximize, Restore and Toggle. Note that it is possible to maximize a view from a different card and it will show over the current card until it is restored or toggled off. The current card will not be affected by the action.

Refresh Action

The refresh action forces a named view to render it's content. The refresh action is usually handled internally for dependent views, but may be useful if the data is changed from outside Perspective, for example through JavaScript or because of a timed change.

Show Action

The show action replaces the current content of a named view with a different content.

Show Card Action

The show card action shows a named card in place of the current one.

Reset Action

The Reset action reverts the dashboard back to the default contents and initial selections. This action is particularly useful for web-based dashboards where the server session remembers the current state throughout the user session. Add a button image with a Reset action to your dashboard so that the user can easily reset the dashboard to its original state without having to logoff and logon again.

Render Report Action

The Render Report action will render the selected report in the perspective with the renderer selected by the user. The output is identical to the rendering in the Report Designer. Often dashboards will be created so that the user can dynamically construct the report contents by navigating through the data views. You can then provide a button image so that the final report can be preserved.

You have the option to control which section(s) in the report will display in a dashboard and which section(s) will be rendered. Open the report template. Click the Functions tab. Type the following function in the Function Definitions tab pane:

function isInDashboard()
{
var mimeType = Renderer.getMimeType();
var rd = Renderer.getRawReport().getRenderDetails(mimeType);
return (rd!=null && rd.getParameterValue("elx.dashboard.reportview"
)=="Yes");
}

To make sure the function works on the selected sections(s), you also need to use script. Double-click a section. The Section Wizard opens. Click the Scripts tab. Type the following script in the Render If field, and repeat the steps on all the selected section(s):

isInDashboard();

When you render the report, you will find out whether the function and script works as anticipated.

It is useful to know whether a report is being run on its own, or as part of a dashboard. This information can be extracted from the render details available from the Renderer object. The parameter "elx.dashboard.reportview" will have the value "Yes" if the report is being rendered as part of a dashboard. Under these circumstances, you might make adjustments to the report content or access information from the dashboard so that the report shows more appropriate contextual information.

Generate Data Action

The Generate Data action can generate data in the selected element to 4 different formats. They are XML, Excel, Comma Separated Data (CSV) and Datasource. This action outputs the data as records, so any formatting of the display is not preserved. If you need to preserve the format of a dashboard cube then use the Generate Excel Cube Action below.

Generate Excel Cube Action

The Generate Excel Cube action can generate data in the selected cube as an Excel spreadsheet. Unlike the Generate Data Action, this action preserves the cube structure and cell rendering that you see on the dashboard.

Script Action

The Script action is the most powerful, because it can interact with the Perspective views, contents and even actions directly. This action is intended for power users and developers.

The JavaScript code executes in the context of the Perspective application itself, which provides some useful helper functions to access content and views.

  • Content getContent(contentName);
  • Panel getPanel(panelName);
  • void refresh(panelName);

In addition, some context objects are available:

  • Parameters: Use Parameters.get("Name") to access any dynamic parameter values.
  • State: The overall dashboard state - from here you can navigate and interact with all parts of the dashboard.
  • thisState: The state on which the event was triggered
  • thisEvent: The event (String) that was triggered

Note

The full Perspective scripting API is described in Chapter 5, Script Reference and the separate PML Object Model documentation.