You are on page 1of 8

Tips or Technique

Alternating Page Headers


Product(s): IBM Cognos 8 Area of Interest: Reporting

Alternating Page Headers

Copyright and Trademarks Licensed Materials - Property of IBM. Copyright IBM Corp. 2009 IBM, the IBM logo, and Cognos are trademarks or registered trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at http://www.ibm.com/legal/ copytrade.shtml While every attempt has been made to ensure that the information in this document is accurate and complete, some typographical errors or technical inaccuracies may exist. IBM does not accept responsibility for any kind of loss resulting from the use of information contained in this document. The information contained in this document is subject to change without notice. This document is maintained by the Best Practices, Product and Technology team. You can send comments, suggestions, and additions to cscogpp@ca.ibm.com.

Business Analytics

Alternating Page Headers

Contents
1 1.1 1.2 2 2.1 2.2 2.3 2.4 INTRODUCTION..............................................................................................4 PURPOSE..................................................................................................................4 APPLICABILITY.............................................................................................................4 CREATING ALTERNATING HEADERS.............................................................. 4 CREATING CREATING CREATING APPLYING
A BASIC REPORT...............................................................................................4 THE HEADER...................................................................................................5 THE CONDITION...............................................................................................6 THE CONDITION TO THE PAGE................................................................................ 7

Business Analytics

Alternating Page Headers

1 Introduction
1.1 Purpose This document describes on how to create a report with alternating header titles. 1.2 Applicability This document was tested in: IBM Cognos 8.4

2 Creating Alternating Headers


This document uses the IBM Cognos 8.4 sample package. 2.1 Creating a basic report First start out creating a report page that will span over multiple pages. 1. Open up Report Studio. 2. Select the Go Sales (query) package.

3. Select Create a new Report or Template.

4. Select List

and then click OK.

5. From the Insertable Objects area, expand Inventory (query) Product

6. Double click on Product line, Product type and Product name so they show on the list on the right hand side.

Business Analytics

Alternating Page Headers

7. In the page header, delete the default Block object. 8. In the Insertable object area, click on the Toolbox tab.

9. Click and drag the table object in to the page header of the page. Set the number of columns to 2 Set the number of rows to 1

Click OK 2.2 Creating the header In these steps, the header name is going to be reproduced twice. This is to alternative hide one or the other depending on the page. 10. From the Toolbox, click and drag the column of the table. Block object to the left hand

11. From the Toolbox, click and drag the Text Item object to the block object on the left hand side. In the text box dialog type in Page Header. Click OK. 12. From the Toolbox, click and drag the Block object to the right hand column of the table. 13. From the Toolbox, click and drag Text Item object to the block object on the right hand side. In the text box dialog type in Page Header. Click OK.

Business Analytics

Alternating Page Headers

14. Then highlight the right block object and click on the button in the tool bar. The report should look like this.

right justified

2.3

Creating the condition.

15. Hover over

Condition Explorer and click on

Variables. String Variable.

16. In the Insertable objects pane, double click on 17. Create an expression that looks like this: mod (PageNumber (),2) Click OK. 18. Click on the Then click OK.

add button and in the dialog box type in the number 0.

19. Click on the add button again and in the dialog box type in the number 1. Then click OK. 20. In the Variables column highlight String1.

Business Analytics

Alternating Page Headers

21. In the Properties area underneath Miscellaneous, rename String1 to Alt Header.

2.4

Applying the condition to the page. This is where the condition is applied to show and hide what header name. 22. Hover over Page Explorer and click on Page1.

23. Click on the Block object in the left hand side of the table in the page header. 24. In the properties area, click on the line. ellipse button in the Style Variable

25. In the Variable drop down box, click on Alt Header. Click OK.

26. Hover over Condition Explorer and under Alt Header click on

0.

Business Analytics

Alternating Page Headers

The centre bar will be green now. 27. In the Properties area, under Box, put the Box type to none.

Now the same steps are going to take place except the right hand side 28. Hover over Page Explorer and click on Page1.

29. Click on the Block object in the right hand side of the table. 30. In the properties area, click on the ellipse button in the Style Variable line. 31. In the Variable drop down box, click on Alt Header. Click OK. 32. Hover over Condition Explorer and under Alt Header click on 1 33. In the Properties area, under Box, put the Box type to none. 34. Run the report by clicking the Run button.

35. Page through the report by clicking the Page down link and notice that the text in the page header is on the left side of the page for odd numbered pages and on the right side of the page for even numbered pages.

Business Analytics

You might also like