Vous êtes sur la page 1sur 28

Lesson 1: Add a list to your report Page 1

In this tutorial, you will create the report page, and then the prompt page.

About this task


This is because when the report runs, the prompt page needs a response before going to the
report pages. It is easier to test your report pages if you create them before creating the
prompt page.
To create a report page:

Procedure
1. Login to Cognos® Connection using bob for both the User ID and Password.
2. Navigate to the Cognos Report Studio page:
a. In Cognos Connection, select Launch and select Report Studio.
b. On the Select a Package (Navigate) page, select Reporting Data Models.
c. Select Reporting Data Model (DW).
d. If you are prompted to allow access to the Clipboard, click Allow Access.
3. Click Create new in the Report Studio Welcome dialog.

4. You will be starting with a blank canvas so click Blank and then click OK.
5. You have a blank workspace. Hover over the Page Explorer in the center vertical
toolbar and click Page 1.

6. Page 1 of your report is displayed, showing you a blank canvas. In the Insertable
Objects pane on the left, click the Toolbox tab.
7. From the toolbox, click and drag a List object to your report.
8. In the Insertable Objects pane, click the Source tab. In the data source tree, go
to Operational Data Store->Test Case Area->Test Case. In this folder, click Project
Name to highlight it. Press your CRTL button, and while it is pressed, click to multi-
selectName, Owner Name and Test Case State to highlight them as well. Then drag
the items to your report list. All four data items will now be arranged in columns in
your list. As you can see, they appear in columns in the order that you selected them in
the tree.

9. Save your report by going to File->Save As. Click the My Folders icon on the left to
select it, or select it from the drop-down menu. Type <Your Name> simple report 1 in
the Name field. Remember to substitute your name for <Your Name>. Click Save.
10. Hover over the Query Explorer in the center vertical toolbar. A query named Query1
has been created. Click Query1.

11. You will see that your query contains the data items that you dragged from the source
to the list. Notice that there is a data item called Name. This means test case name.
Click the data item Name. Its Properties pane will open on the lower left. In the
Properties pane in the lower left, click in the field next to Name. Type Test Case Name to
replace the existing text. Click outside of the field, and the new name will take effect.

12. Now you will rename the query to a more meaningful name. Go to View->Queries in
the main toolbar.
13. The Query view that opens shows you all of the queries in your report. Click Query1 to
highlight it and to open its Properties pane. In the Properties pane, click in the text field
next to Name. Delete the name Query1, and type Query for List. Click in a blank space
outside of the name field, and your new name will take effect.
14. Now test your report by going to Run->View Tabular Data in the main toolbar.
15. If a warning dialog box opens, click OK. A Cognos Viewer window will open in your
Internet browser showing you your list populated with data.
16. In the Cognos Viewer window, use the Top/Page Up/Page Down/Bottom buttons to
scroll through the list. Also, hover over the buttons in the upper-right to see what they
do. Then close the Cognos Viewer window.

Summary
In this lesson you have learned how to create and populate with data from a list query
Lesson 2: Create a prompt page
In this lesson you create a prompt on a prompt page for your report.

About this task


This lesson teaches you how to create a prompt for the report you created in Lesson 1: Add a list to
your report Page 1 This prompt will ask the user to select a project, and then present list report data
for only the project that they select.
To create the prompt:

Procedure
1. From the last screen in lesson 1, hover over the Page Explorer in the center vertical toolbar.
Click Prompt Pages. (For instructions on navigating to the page see step 1 in the previous
lesson. Hover over the Page Explorer in the center vertical toolbar. ClickPrompt Pages.

2. You will see an empty Prompt Pages area, and your Toolbox will be open in the Insertable
Objects pane. Click and drag a Pagefrom the Toolbox to the Prompt Pages area. This creates
a prompt page named Prompt Page1.
3. Double-click Prompt Page1 to edit it. The page is displayed. The Toolbox is also displayed in
the Insertable Objects pane.
4. To title the page, double-click the area that says “Double-click to edit text.” In the text box that
appears, type Choose a project from the prompt. Click OK.

5. Your prompt page has a title. You will now add a value prompt. Go to the Toolbox and drag
and drop a value prompt object from the toolbox to your page. A Prompt Wizard-Value Prompt
will appear. (Note that there are many other types of prompts that you can add. You will use a
value prompt because this type of prompt allows users to select values from a list).

6. In the Choose Parameter window, leave the radio button selected next to Create a new
parameter. (Note that if you had already created a parameter for some other prompt, you could
have selected it by using the “Use existing parameter” option). In the field that
says Parameter1, delete Parameter1 and type Project.

7. Click Next. In the Create Filter window, click to uncheck the box next to “Create a
parameterized filter” because you do not want to create a filter here. You will create a filter
later that will filter your list report by your parameter.

8. Click Next. In the Populate Control window, you will follow the steps below to define a query
that searches on Project ID but that displays Project Name. The query will be connected to the
Project parameter that you just created for your prompt. The query brings the data to the
parameter for the user to select.
a. In the Name field, delete Query 1 and type Project Query.
b. Click the ellipses (…) next to the Values to use: field and navigate to Operational Data Store-
>Project Area->Project->Project ID. Click Project ID to highlight it and click OK. (To
change this value later, you can use the prompt’s Properties).
c. Then click the ellipses (…) next to the Values to display: field and navigate to Operational
Data Store->Project Area->Project-> Name. Click Name to highlight it and click OK. (To
change this value later, you can use the prompt’s Properties).
9. Click Finish. A value prompt is displayed on your prompt page with some buttons
(Cancel/Back/Next/Finish) at the bottom

10. Click File->Save in the main toolbar to save your work so far.
11. Hover over your Query Explorer in the center vertical bar. You will see that your query
named Project Query has been added to your set of queries.
12. Click Project Query to open it. When the query opens, you will see that there are two data
items in this query. They are the same data items you added as Value to use (Project ID) and
Value to display (Name).

13. Click the Name data item. The Properties pane will open on the lower left. In the Properties
pane, click in the field next to Name, and type Project Name to replace the existing text. This is
to clarify what this data item really is. When you are done typing, click outside of the Name
field and the new name will take effect.
14. Hover over Page Explorer and click Prompt Page 1 to return to your prompt page. On the
prompt page, click your value prompt to highlight it. The prompt’s properties will appear in the
Properties pane in the lower left.

Note
o In the Properties Data section, the prompt is connected to the ProjectQuery query that you
created. The Use Value is Project ID. The Display Value is Project Name. If you needed to
change the Use Value or the Display Value to a new data item, you would first need to add your
new data item to the ProjectQuery Query. Then you could change Use Value or Display Value to
the new data item here in the prompt properties.
o In the Properties General section, you can change settings for the prompt. Do not change them
now. You can explore the impact of these options later.
15. Now test-run your report. In the main top toolbar, go to Run-> Run Report – HTML. A
Cognos® Viewer window will open showing your prompt page. When you click your prompt,
it will drop down and show you the names of all projects available.

16. Select JKE Banking (Quality Management) and then click Finish at the bottom of the page.
The report accepts your selection, and shows you the next page of the report that contains the
list.
17. In JKE Banking, there is only data for JKE Banking (Quality Management) but there is no data
for other projects. This means that if you select another project, it should say “No data
available”. Click the Run button (green arrow). This takes you back to the prompt. Select JKE
Banking (Change Management) and click Finish. Instead of saying “No data available”, the
report again shows all data available. This is because the list report is not connected in any way
to the prompt parameter. In the next lesson you will now create a Detail Filter to filter the list
report by the parameter in the prompt.
18. Close the Cognos Connection Viewer window and return to Report Studio.

Summary
19. You have completed this tutorial and created a prompt page.
Lesson 3: Add a filter to the QueryForCharts query
Create a Detail Filter to filter the Page 1 list by the value specified in the prompt.

About this task


This lesson is a continuation of lessons 1 and 2 in this module. Follow the steps in those
lessons to create the report you use in this lesson.
NoteRemember that when you created your prompt, you created a parameter that used
Project ID as the “Value to use”. You want the data shown in your list to be filtered by that
parameter. Therefore you need to add the test case project ID data item to your list query,
and then tell Report Studio to filter the test case Project IDs in the list by whatever project
selection the user makes in the prompt parameter. That way, the user selects a project in the
prompt, and clicks Finish, and then the user will see the list containing only test case data
related to that project.

To create a detail filter:


Procedure
1. In Report Studio, open your Query for List query by one of these methods:
a. Hover over the Query Explorer in the center vertical toolbar. Click the Query for
List query to open it.
b. Go to View->Queries. Double-click the Query for List query to open it.
2. You will add the Project ID data item to the list query. Click the Source tab of the Insertable
Objects pane to open it. Go toOperational Data Store->Test Case Area->Test Case-
>Project ID. Double-click Project ID, and it will be added to the data items list. Do not worry
about the order of the data items in the list. Their order here does not affect how they appear
in the report.
3. Rename the Project ID data item by clicking in the Properties pane, Name text field, and
typing Test case Project ID. Click outside of the text field, and your new name will take
effect

4. Now you need to tell the report to link the Project ID that the user selects in the parameter to
the Test Case Project ID that appears in the list. To do that, you will create a Detail Filter. In
the Insertable Objects pane, click the Toolbox tab. From the toolbox, drag a Filter to the
Detail Filters box on the upper right.
5. The Detail Filter Expression – Query 1 wizard opens. Observe the Available Components
area on the left with the tabs at the bottom, and observe the Expression Definition pane. This
is where you will define your filter expression. You want your expression to say that “test
case project IDs shown in the list should equal the Project parameter selection”. You will
create this expression by following the steps below.

6. In the Available Components area, click the Data Items tab. You will see all the data items
from the Query for List query. Double-click the Test Case Project ID data item. It will be
added to the Expression Definition editor.
7. Now click the Functions tab in the Available Components area. Expand Operators, and
double-click the equal (=) sign. You may also just type an equal sign.
8. Now click the Parameters tab in the Available Components area. Double-click Project to
add it to the expression. Your expression should now be [Test Case Project ID]=?Project?
9. Your expression is complete. Your Detail Filter expression tells your list report to show only
test case project IDs that are the same as (equal to) the Project parameter selection. This is
what you want. Click OK. You will see the expression in the Detail Filters pane of the query

10. Click the Save button to save your work. Go to Run->Run Report-HTML to test your report.
11. Your goal at the start of the tutorial was to create a prompt page with a drop-down that
allows the user to select a project:
12. Your second goal was to see a report page with list data filtered according to the user’s
selection of project. Select JKE Banking (Quality Management) and then click
the Finish button at the bottom.
13. However, since there is only data for JKE Banking, you also need to test that the prompt is
working to filter the list. In Cognos® Viewer, click the green arrow Run button on the upper
right. Select JKE Banking (Change Management). Click Finish. The report will show No
Data Available. This means that the report and prompt are working as planned. This ends
this tutorial.

Vous aimerez peut-être aussi