Thursday, 9 January 2014

Raw Banding in Cognos

Sometimes we may need to create a list report that alternates the row colors. Unfortunately Cognos dose not provide direct way for raw banding unlike many other reporting tools. This can be achieved in following ways

1. Open Report Studio against Go Sales and Retailers Sample Package
2. Select List report, and drag in Product type, Product name, Quantity items
3. Mouse over on Query Explorer, click Query1
4. Click Toolbox tab, and drag in a data item in the Query1
5. The data item has the expression as
mod(running-count([Product name]),2), and named as Test
6. Mouse over on Condition Explorer, click Variables
7. Drag Boolean Variable in Variables pane as expression
[Query1].[Test]=1, and named the variable as grey
8. Mouse over on Page Explorer, click Page1
9. Select check list column; assign Style Variable under Conditional Section as grey variable
10. Click Select Ancestor and select Page
11. Under Data section, assign Query1 for Query cell; in Properties cell, check on Test
12. Click on any column, select List Column Body Style. Mouse over on Conditional Explorer, click Yes under grey variable
13. For each column, assign the relevant Background Color under Color & Background
14. Run the report

1 comment: