Saturday, December 20, 2014

How to design Cognos interactive reports 09 - Make a filter flexible without page refresh

    1. Context

We have discussed all solutions to design Cognos interactive reports (01,02,03,04,05,06,07,08). There is one major problem with page refresh for filters. As soon as you change value from the first value prompt, then the value for the second one will change, and page will be refreshed as the same time. This page refresh is big problem, as report will be regenerated. In case when report is very slow, change filter will take long time to accomplish, which is unacceptable for business users.  The solution is to make sure report won’t be re-generated during this page refresh, or make the report as condition block and not run it. This document will demonstrate the idea to make filter flexible without page refresh. Please see attached report specification for review (version 10.2 with sample Package GoSales)

    1. Sample

The sample above is to make sure when switch new selection from value prompt, report will be disappeared. At the same time, ask you to specify filters. Certainly, we can make interface much better in real application. (it is intended to show idea only.)  
    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.

Prompt description script 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'))
    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 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. In this case, they will go back either to choose no filter, or specify value. The good idea is report takes no time to give business users response.

No comments:

Post a Comment