COGNOS REPORTNET TIPS AND TRICKS
DISPLAY BOTH THE VALUE AND DESCRIPTION IN A PROMPT
1. When you create a new prompt, by default, only one column gets displayed (normally the Value) in the list. In this example, only the actual term code gets displayed.
2. In some cases, you may want to display both the term and the description of the term (200901 Fall 2008-2009) as in this example:
3. To do so, first open the report in design view. When you open an existing report in design view, the default page that is displayed is the “Report Page”. The vertical bar in the center is the Explorer Bar.
4. Hover your mouse over the Query icon on the Explorer Bar, the Query contents will "fly out" to the right. Click the query that contains the data elements used for your value prompt. In this case, we will select SEL_TERM_QUERY.
5. Double click the SEL_TERM_QUERY to view its contents. If it's not already listed in your prompt query, find the VALUE_DESC in the LOV table on the left. Double click to add it to the list of Data Items on the right.
6. In the Insertable objects pane, click the Toolbox icon at the bottom. Then double click the Data Item object.
7. In the Expression Definition window, add the following code. Check for errors by clicking the validation button (green check mark). Then click OK.
8. With the new Data Item1 highlighted under Data Items on the right side, click the Name control in the Properties Pane. Rename it something more meaningful such as Value and Description.
9. Go back to the Prompt Page and select the Prompt. In the Properties pane, click the Display Value property and select "Value and Description".
10. Run the report. You will now see the term and term description in the drop down value prompt.
11. Ensure that the prompt is sorting properly. In this case, we want the prompt to sort on the Term, not the Term Description. Go to the Query Explorer, and select the Prompt Query (SEL_TERM_QUERY). Select the item to use for sorting (VALUE). In the Properties Pane, click Pre-Sort and choose "Sort ascending" from the drop down.