Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

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

2.71/5 (4 votes)
16 Mar 2008CPOL 1  
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:

    VB.NET
    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

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)