State

The State object represents the dashboard as a whole. It provides a set of useful services and acts as a container for the named states which link the contents and views that you define. To access a particular state, you need to append the name to the State object. For example, if you have a view named "MyCube", you can access the state of that view like this:

State.MyCube

If your view name contains spaces, then you need to use an alternate JavaScript syntax:

State.["My Cube"]

to achieve the same effect.

We will start by reviewing the API of the State object itself. Note that most of these services are available through the Action mechanism, so you don't have to use scripts to perform these commands - these services are only for situations where you want to chain a few actions together in a certain order, or maybe add some additional scripted logic.

void excelCube(String cubeName)

Generate the presentation of a cube as an Excel spreadsheet. The user will be prompted to enter a filename.

void generate(String contentName)

Generate the data shown by a particular content as a file. The user will be prompted to enter a filename and output type (e.g. XML, CSV, XLS etc.)

String getCurrentCard()

Get the name of the current card

String getParameterValue(String name)

Get the value associated with the parameter name, or null if the parameter is not found.

Perspective getPerspective()

Get the Perspective object which represents the whole dashboard. See the PML Object Model documentation for full details on the dashboard object model.

IState getState(String name)

This provides another mechanism for getting the individual state objects, it is synonymous with State.name as described above.

void maximize(String viewName)

Maximize the named view, which need not be on the current card. The current card does not change, on restore the original card will show again.

void render(String reportName)

Render the named report. The user will be prompted to enter the render type and destination.

void reset()

Reset the current dashboard state back to the initial default view states and selections.

void restore()

Restore any maximized view back to the normal position.

void show(String view, String content)

Show the named content in the named view.

void showCard(String perspective, String card)

Replaces the current card with a new one, which could come from the same dashboard file, or jump to another dashboard. The perspective parameter should contain the full URL of a pml file (e.g. "repository:/User/jane/mydash.pml") or null, if the card is located in the current dashboard.