65.9K
CodeProject is changing. Read more.
Home

How to Select What Fields to Display on a Report from a Multi-value

starIconstarIcon
emptyStarIcon
starIcon
emptyStarIconemptyStarIcon

2.71/5 (4 votes)

Mar 17, 2008

CPOL
viewsIcon

26801

How to select what fields to display on a report from a multi-value

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.

  1. Add a multi-value parameter including all the fields that need to be selected.

1.JPG

  1. Add a custom function. This function is used to find if the specified field is selected.

    2.JPG

  2. 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
  3. Set the expression of column’s visibility property as “=Not Code.CheckSelect(0)”.

History

  • 17th March, 2008: Initial post