Click here to Skip to main content
Licence CPOL
First Posted 16 Mar 2008
Views 14,886
Bookmarked 18 times

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

By | 16 Mar 2008 | Article
How to select what fields to display on a report from a multi-value
 
Part of The SQL Zone sponsored by
See Also

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

License

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

About the Author

pengyi



China China

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionWhy so complicated? Pinmemberinterfernet0:31 9 Feb '09  
AnswerRe: Why so complicated? Pinmemberpengyi3:46 20 Sep '09  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120517.1 | Last Updated 17 Mar 2008
Article Copyright 2008 by pengyi
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid