2
We will be creating a report which conditionally displays a subreport depending on which tab is clicked. In reality, we are simply creating a 1-row table and do ing a drill-through on each cell, using the parameter passed to determine which subreport to display. Steps:Create the following report using Go Sales & Retailers: 1) Create a List report. 2) Create a Crosstab report below the list report associated with Query 2. 3) Go to Query Explorer and select Queries. For ReportNet: a) Add two new queries, Query 3 and Query 4. For Cognos 8: a) Add one new query, Query 3. 4) Create a parameter: a) Add a Value Prompt to the main report page. Place it just before the List Rep ort. b) Create a new parameter named "report" and click Finish. c) Select the value prompt and under Properties pane, set the following: c.1) Box Type to "None" c.2) Default Selections to "List Report" (choose Simple Selection) c.3) Required to No. This creates a parameter without a prompt. 5) Go to Query Explorer and select Query 3. a) Under the Insertable objects add "Quantity" from the "Orders" query subject t o the Data Items pane. b) Select the Toolbox tab and drag a Data Item to the Data Items Pane. Enter the  following expression: 'List Report'. c) Drag a second Data Item to the Data Items pane. Enter the following expressio n: 'Crosstab Report'. e) Select "Data Item1" and set the "Name" property to "List Report1". f) Select "Data Item2" and set the "Name" property to "Crosstab Report1". 6) Go to Page Explorer and select the report page. 7) Select any item in the report and under the Ancestor tab (next to Properties title in properties pane), select Page. Then set the Query property to Query 3. 8) Select the Conditional Explorer and click on Variables. a) Add a new string variable called "Report Name". b) The expression for this variable is: if (ParamValue('report') is null) then ('List Report') else (ParamValue('report' )) Note: The default report is the "List Report" which is defined if the 'report' p arameter is null c) Add a value to the "Report Name" variable for each subreport you want in the tabbed report. E.g.: "List Report", "Crosstab Report", etc. 9) From the report page, click the Toolbox tab under Insertable Objects and drag  a Conditional Block List (if using CRN) or a Conditional Blocks (if using C8) o bject just below the Crosstab report. 10) Select the Conditional Block. Under the Properties pane, set "Conditional Bl ock" (for ReportNet) or "Block Variable" (for Cognos 8) to the "Report Name" var iable defined in step (8). Click OK. 11) Then set the "Current Block" property to "List Report", select a column in t he list report and choose the "List" under the Ancestor tab (to the right of the  Properties pane title). Then, drag the List report into the Conditional Block. 12) Now, select the Conditional Block again and set the "Current Block" property  to "Crosstab Report". Then, select a cell in the crosstab report and choose the  "Crosstab" under the Ancestor tab (to the right of the Properties pane title).

Tabbed Report

  • Upload
    varma43

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

 

We will be creating a report which conditionally displays a subreport dependingon which tab is clicked. In reality, we are simply creating a 1-row table and doing a drill-through on each cell, using the parameter passed to determine whichsubreport to display.Steps:Create the following report using Go Sales & Retailers:1) Create a List report.2) Create a Crosstab report below the list report associated with Query 2.3) Go to Query Explorer and select Queries.For ReportNet:

a) Add two new queries, Query 3 and Query 4.For Cognos 8:

a) Add one new query, Query 3.4) Create a parameter:

a) Add a Value Prompt to the main report page. Place it just before the List Report.b) Create a new parameter named "report" and click Finish.c) Select the value prompt and under Properties pane, set the following:

c.1) Box Type to "None"c.2) Default Selections to "List Report" (choose Simple Selection)c.3) Required to No.This creates a parameter without a prompt.5) Go to Query Explorer and select Query 3.a) Under the Insertable objects add "Quantity" from the "Orders" query subject to the Data Items pane.b) Select the Toolbox tab and drag a Data Item to the Data Items Pane. Enter the following expression: 'List Report'.c) Drag a second Data Item to the Data Items pane. Enter the following expression: 'Crosstab Report'.e) Select "Data Item1" and set the "Name" property to "List Report1".f) Select "Data Item2" and set the "Name" property to "Crosstab Report1".6) Go to Page Explorer and select the report page.7) Select any item in the report and under the Ancestor tab (next to Propertiestitle in properties pane), select Page. Then set the Query property to Query 3.8) Select the Conditional Explorer and click on Variables.

a) Add a new string variable called "Report Name".

b) The expression for this variable is:if (ParamValue('report') is null) then ('List Report') else (ParamValue('report'))Note: The default report is the "List Report" which is defined if the 'report' parameter is nullc) Add a value to the "Report Name" variable for each subreport you want in thetabbed report. E.g.: "List Report", "Crosstab Report", etc.9) From the report page, click the Toolbox tab under Insertable Objects and drag a Conditional Block List (if using CRN) or a Conditional Blocks (if using C8) object just below the Crosstab report.10) Select the Conditional Block. Under the Properties pane, set "Conditional Block" (for ReportNet) or "Block Variable" (for Cognos 8) to the "Report Name" variable defined in step (8). Click OK.11) Then set the "Current Block" property to "List Report", select a column in the list report and choose the "List" under the Ancestor tab (to the right of the Properties pane title). Then, drag the List report into the Conditional Block.12) Now, select the Conditional Block again and set the "Current Block" property to "Crosstab Report". Then, select a cell in the crosstab report and choose the "Crosstab" under the Ancestor tab (to the right of the Properties pane title).

 

Then drag the Crosstab into the Conditional Block.Note: Populating the conditional block with each of the reports you want to display by using the "Current Block" property to associate each report with a "Report Name" value.You now have a report which displays a different subreport depending on the value of a parameter.13) Click the Toolbox tab under Insertable Objects and drag a New List report below the Conditional Block.

a) Select the list report and under Ancestor tab (to the right of the Properties pane title), select List.b) Set the Query to Query 3.14) Add an N x 1 table into the List report created in step 13, where N is the number of tabs you have. Click the padlock button to unlock the cells in the report.a) In the left column of the table, add a text item labelled "List Report".b) In the right column of the table, add a text item labelled "Crosstab Report".c) Next, we will add a drill-through to each label in the table. Save the report as "tabbedreport".15) Select the "List Report" label and choose the "Drill throughs" button on the toolbar.

a) Set the "Report" to the "tabbedreport" you just savedb) Click the "pencil" icon to edit the parameters in the drill throughc) Set "method" to "Pass data item value"d) Set the "value" to "List Report1"16) select the "Crosstab Report" label and choose the "Drill throughs" button on the toolbar.a) Set the "Report" to the "tabbedreport" you just savedb) Click the "pencil" icon to edit the parameters in the drill throughc) Set "method" to "Pass data item value"d) Set the "value" to "Crosstab Report1"17) Select the Conditional Block and drag it into the List Report defined in step 13, just below the Table.Note: If the conditional block ends up to the right of the table, you must undothe move and redo it making sure it ends up below the table within the List report object. (You should place the cursor in the bottom-right of the table when dropping the conditional block into the list. This will ensure it gets placed in the List report just below the table.)18) Select any item in the List report created in Step 13. Under the Ancestor tab choose the "List Column", not "List Columns". Double-click the "Border" property and set the following:

a) Style=Noneb) Click the Button just below the "Preview" text. Click Apply (This removes the border for the List Column).c) Click OK.19) Select the "List Column Title" for the List report created in Step 13 (it currently has a "Table" text item listed init). Under the Ancestor tab choose theList. Set the following in the Properties pane:

Column Titles=Hide