Introduction
Sometimes, clients want to select which fields need to be displayed in the report. SSRS can provide this function through multi-value parameter and custom code.
- Add a multi-value parameter including all the fields that need to be selected.
- Add a custom function. This function is used to find if the specified field is selected.
The source code is as follows:
public function CheckSelect(byval s1 as integer) as boolean
CheckSelect=false
dim i as integer
i=0
for i=0 to Report.Parameters!Report_Parameter_0.count()-1 step 1
if s1=Report.Parameters!Report_Parameter_0.Value(i) then CheckSelect=true
next i
end function
- Set the expression of column’s
visibility
property as “=Not Code.CheckSelect(0)
”.
History
- 17th March, 2008: Initial post