Blog

Conditional Formatting in Cognos Report Studio

Conditional Formatting

  • Conditional Formatting is a process of formatting the business data based on given condition.
  • Users can quickly analyze the business data by using conditional formatting
  • Conditional formatting can be done with the help of variables
  • There are three types of variables – STRING, BOOLEAN, REPORT LANGUAGE VARIABLES
  • Variables are used to hold the results of an expression

Conditional formatting – String variables:

  • Create a list report with the following query items
  • Order year, Order method, Quantity
  • Group on order year
  • Total on quantity
  • Go to conditional explorer-  Click on variables
  • From insertable objects pane drag the string variable and drop it on variable window
  • Define the following expression in the expression definition window
  • if ([Query1].[order year]=2004) then (1)
  • else if ([Query1].[order year]=2005) then (2)
  • else if([Query1].[order year]=2006) then (3)
  • Click on validate- click on OK
  • Add the variables 1,2,3 to the values list
  • Click on add –  give values               

          1
          2
          3

  • Click on OK
  • From page explorer,
  • Open the report page page1
  • Select order year data item
  • From the ancestor properties click on list columns body style
  • From conditional explorer,
  • Select the string variable 1
  • From properties pane, select style variable
  • Click on eclipses { … }
  • Set the variable as string1
  • Select the string variable1
  • Select the font property-  click on eclipses
  • Set the font size and color
  • From condition explorer
  • Select the string variable 2
  • Set the font size and color
  • From condition explorer,
  • Select the string variable 3
  • Set the font size and color
  • Turn off the explorer bar (By double clicking) and run the report
Learn how to use Cognos, from beginner basics to advanced techniques, with online video tutorials taught by industry experts. Enroll for Free Cognos Training Demo!

CONDITIONAL FORMATTING – STRING VARIAB LES:

Conditional formatting – Boolean variables

  • Create a list report with the following items
  • Product line, Product type, Product name, Margin
  • From conditional explorer click on variables
  • From insertable objects
  • Drag the Boolean variable and drop on variable window
  • Define the following expression in expression definition window
  • Drag the margin from available components and drop in the expression window
  • [Query1].[Margin]>0.3
  • Validate – à  OK
  • From page explorer – à Select page1
  • Select any data item in the report
  • From ancestor select list column body style
  • From properties pane
  • Select style variable property
  • Click on eclipses
  • From drop down list box
  • Select the Boolean1 variable- à Click on OK
  • From conditional explorer
  • Select Boolean variable – Yes
  • From the properties
  • Set the font property—>Click on eclipses
  • Set the font size and color
  • From condition explorer
  • Select the Boolean variable as No
  • From the properties pane—>Select font properties
  • Set the properties—> Turn off the explorer bar
  • Save & Run the report

Frequently Asked Cognos Interview Questions & Answers

CONDITIONAL FORMATTING – BOOLEAN VARIABLE

Conditional Formatting – Report Language Variable

  • Create a list report with the following query items
  • Order year, Order method, Quantity, Revenue
  • Group on order year
  • Total on quantity and revenue
  • From conditional explorer bar,
  • Click on variables
  • From insertable objects on
  • Drag the report language variable and drop on variables window
  • Select Chinese language from the list of languages
  • Click on OK
  • From page explorer,
  • Click on Page1
  • Select any data item
  • From ancestor
  • Select list
  • From properties pane
  • Select the style variable
  • Click on eclipses
  • Select the style variable on report language1
  • Select Chinese
  • Click on OK
  • From conditional explorer
  • Select the report language variable as Chinese
  • Select the font property
  • Set the font size & color
  • From condition explorer,
  • Select the report language variable as others
  • From properties
  • Select the font
  • Set the font properties & size
  • Turn off the explorer bar
  • Save the report
  • Set run options – Chinese
  • Run the report

CONDITIONAL FORMATTING – REPORT LANGUAGE VARIAB LE

Explore Cognos Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

RELATED COURSES

Get Updates on Tech posts, Interview & Certification questions and training schedules