Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos Report Studio -- Display custom message when no rows returned

Your end users may appreciate the ability to have a message returned when there is no related data for their search.  It could give them a nice, warm and fuzzy feeling knowing that they did perform the correct steps but unfortunately there just was no data. 

From within Cognos Report Studio you would have to create a footer for the list with the custom message.  You would then make it conditional based upon the number of rows returned.  If the number of rows returned is not greater than 0, then the report would show your custom message.

 

Here are the steps to achieve this task:

  1. From within Cognos Report Studio you would create a list report and select the list using the select ancestor tool in the properties panel.
  2. Create a List Footer and select the text item in the List Footer. Modify it to the custom message you want, ie: “There are no records for your selection”.
  3. Create a new boolean variable. Using the Cognos Report Studio built-in function RowNumber(), create the following expression: RowNumber() > 0
  4. Select the List Footer in the list in your report and set the Conditional Style in the properties panel to use the variable you just created.
  5. Using the Conditional Explorer select the "Yes" value from your variable.
  6. Set the "Box Type" property for the List Footer to "None".
  7. Change the "Border" property to be style set to "None" on all sides and apply
  8. Turn off the Conditional Explorer and use a prompt or filter to test your report.