Monday, January 31, 2011

Presentation variable and prompts values in Report Titles


Normally, to let user know that what are the selected values in dashboard prompt, we use narrative views or Filter views.
In this blog entry, you will see that how to use presentation variable in directly narrative view and in dashboard objects.
Recently, I had a requirement like prompt is populated with some values along with All Choices
When user selects a particular value from drop-down that value should be displayed on report and when select All Choices nothing to be display.
Variables in Narrative View:
For this i went with the following approach.
1. Create a prompt with presentation variable say, var_region and set Default to: All Choices. Save the prompt
prompt
2. Create a report with some measures and the dimension column i used as prompt in the step 1
criteria
3. Click on Results tab, and add the narrative view to compound layout
4. In Narrative section mention the presentation variable name directly @{var_region}, set Rows to display to 1 and click OK to add the narrative to compound layout
narrative
5. Arrange views, so that the narrative view comes under the title view
arrange-cl
6. Go to Criteria tab
7. Apply filter condition on that dimension and assign presentation variable to the filter. Save the report
filter-condition
8. Now create a dashboard page and add the prompt and report just now you created
9. Save the page and you can see that there nothing appears in narrative view as default value for prompt is All Choices.
10. Select any value from prompt and click on Go. You will see the selected item in report.
Note: If you are writing any text in narrative view like, Region is:@{var_region}, then even for all choices the text will be shown but no value shown for prompt
So, when there All choices option is selected in prompt associated with presentation variable, it holds nothing. It holds the value when there is single value selected. Of course, variables contains only single value
Variables in Dashboard Object – Text
  1. Edit the dashboard page.
  2. Add the Text dashboard object to the existing section
text-object
3. Click on Properties option for Text object and write the following code.
<center><font Size=’4′><font color=”#000000″>@{var_region}</font></font></center>
Don’t forget to click on Contains HTML Markup check box
text-properties
4. Click on Properties of Report > Show View and select Table1 to show only the table view on dashboard, so that the narrative we are not showing. This avoids the displaying prompt values twice
show-view
5. Save the page and go to dashboard. As default value is All Choices, you will not see anything on dashboard related to text object
6. Select any value from drop-down and click on Go, and watch that the selected item is appears on dashboard
dashboard-result
Normally, this post explains how to use presentation variables directly in views or text dashboard object and displaying prompt values in report.

No comments:

Post a Comment