Saturday, January 10, 2015

How to design Cognos interactive reports 10 - Make multiple filters flexible without page refresh

    1. Context

In real applications, there are multiple filters. Normally, we organize each dimension as a filter. We can simply extend the idea from last blog (How to design Cognos interactive reports 10) and to make sure that page is not refreshed when there are any filter changes. This document will demonstrate the idea to make multiple filters flexible without page refresh. Please see attached report specification for review (version 10.2 with sample Package GoSales)

    1. Sample

In this case, there are two filters. During the click of changing value prompts, the main report is disappeared. We can make indication to business users that they need to specify filters
    1. Prompt

      1. First value prompt

      1. Second List box

This filter #prompt ('pFilter1_Column','token')#  makes it possible to have values depending on the selection of value prompt. Please also note that cascade source is specified for list box.

Both prompts description scripts below
case  when ( ParamDisplayValue('pFilter1_Column') = 'No Filter' )  then ('No Filter')
        when  ( (ParamDisplayValue('pFilter1_Column') <> 'No Filter')  and ( ParamDisplayValue('pFilter1_Values') is null ) ) then ('Specify ' + ParamDisplayValue('pFilter1_Column'))
        else  (ParamDisplayValue('pFilter1_Column')  + ': ' + ParamDisplayValue('pFilter1_Values'))

case  when ( ParamDisplayValue('pFilter2_Column') = 'No Filter' )  then ('No Filter')
        when  ( (ParamDisplayValue('pFilter2_Column') <> 'No Filter')  and ( ParamDisplayValue('pFilter2_Values') is null ) ) then ('Specify ' + ParamDisplayValue('pFilter2_Column'))
        else  (ParamDisplayValue('pFilter2_Column')  + ': ' + ParamDisplayValue('pFilter2_Values'))

    1. Query

The key to make filters flexible is to apply prompt token
#Prompt('pFilter1_Column', 'token')# in (?pFilter1_Values?)
    1. Layout

The main report only renders with showData variable

The ShowData is only defined as combined with AND condition, each filter has two cases:
  1. There is no filter, or
  2. Some values are specified
Otherwise, business users will get indication that they need to specify value.

Only if all filters are in these status, then the the main report will be refreshed. The good idea is report takes no time to give business users response for each filter.

No comments:

Post a Comment