Oracle® Business Intelligence Answers, Delivers, and Interactive Dashboards User Guide > Basics of Working with Requests in Oracle BI Answers >
Using Variables to Display Values in Request Results, Dashboards and iBots
You can reference a session variable, repository variable (e.g. User.displayName), or a presentation variable, and use its value in request results, dashboards and iBots. For more information about variables, see Oracle Business Intelligence Server Administration Guide. This section contains the following topics:
What are session variables, repository variables, and presentation variables?
Session and repository variables are pre-defined values held on the server (e.g. NQ_SESSION.System.currentTime). A presentation variable must be declared in a dashboard prompt (using the Set Variable field), and its name and value are determined by the user, either when it is initially declared, or when it is referenced in request results, dashboards and iBots. For more information about declaring presentation variables in a dashoard prompt, see Creating a Dashboard Prompt for Filtering Oracle BI Requests. The following examples suggest how you might reference a session variable or a presentation variable: - Example 1 - Referencing a session variable
To enable an author to display the current user's name in a report title view, the author simply adds a reference to the session variable @{NQ_SESSION.User.displayName} to the report title view. This session variable displays the current user name in the title view.
- Example 2 - Referencing a presentation variable
Where a dashboard report displays a prompt for a single region, the author would like to display the region selected by the user in the title of the dashboard report. To do so, the author simply adds a reference to a presentation variable in the report title for example, @{variables.myFavoriteRegion}. The presentation variable (myFavoriteRegion) needs to have been declared for the dashboard prompt. This presentation variable displays whatever region has been entered by the user in this dashboard prompt.
Where can you reference variables?
You can reference variables in the following areas:
What is the syntax for referencing session variables?
The syntax for referencing session variables is as follows: @{NQ_SESSION.variableName} For example, @{NQ_SESSION.dashboard.description} - NQ_SESSION - indicates that this item references a session variable.
- variableName - a reference to an object available in the current session context. For example: dashboard.description.
What is the syntax for referencing repository and presentation variables?
The syntax for referencing repository and presentation variables is as follows: - @{<variableName>}{<value>}[format] - for repository variables
For example, @{dashboard.path} - inserts the path to the current dashboard.
- @{variables.<variableName>}{<value>}[format] - for presentation variables
For example, @{variables.myFavoriteRegion}{Central} - inserts the value of the presentation variable myFavoriteRegion.
What pre-defined variables can be referenced in request results, dashboards and iBots?
The following table contains a list of pre-defined variables that can be referenced in request results, dashboards, and iBots. Table 7.
|
|
|
System |
productVersion currentTime |
system.productVersion = 10.1.3.2 (Build 091506.1900) system.currentTime = 2006-9-21 14:1:35 |
Session |
locale language rtl timeZone loginTime logoutTime lastAccessTime currentUser |
session.locale = en-gb session.language = en session.rtl = false session.timeZone = Unknown Time Zone session.loginTime = 2006-9-21 14:0:17 session.logoutTime = 2006-9-21 16:0:17 session.lastAccessTime = 2006-9-21 14:01:35 session.currentUser = administrator |
User |
id displayName homeDirectory |
user.id = administrator user.displayName = administrator user.homeDirectory = /users/administrator |
Dashboard |
currentPage xml |
dashboard.currentPage = test page name dashboard.xml = the dashboard XML |
|