-
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)
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
Prompt
First value prompt
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'))
end
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'))
end
Query
The key to make filters flexible is to apply prompt token
#Prompt('pFilter1_Column', 'token')# in (?pFilter1_Values?)
Layout
The main report only renders with showData variable
The ShowData is only defined as combined with AND condition, each filter has two cases:
- There is no filter, or
- 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