none
How to hide or make invisible a Microsoft Report Viewer subreport using Boolean parameter? RRS feed

  • Question

  • How to hide or make invisible a Microsoft Report Viewer subreport using Boolean parameter?

    I have a main report with 4-6 subreports and i want to hide or make invisible subreports using boolean parameter. I m using Microsoft Report Viewer 2010

    • Moved by Bob Shen Monday, September 17, 2012 2:48 AM (From:Visual C# General)
    Monday, September 10, 2012 3:45 PM

All replies

  • Put some subreport inside your report. then right-click, Subreport Properties -> Visibility -> Show or hide based on an expression. Then you just make something like this

    =Parameters!myParameter.Value.Equals("HAVE")

    So if your parameter value is HAVE, this report will hide, if not will normally appear. I recommend you do like this instead a bool parameter, you just pass one string, if it Y or N and make your conditions as i explain above.



    Web Developer


    • Edited by Norkk Monday, September 10, 2012 4:05 PM
    Monday, September 10, 2012 4:04 PM
  • what is should be myParameter type? Is this a Text Parameter or Boolean parameter ?
    Monday, September 10, 2012 7:16 PM
  • A text parameter.

    Web Developer

    Monday, September 10, 2012 7:22 PM
  • thank you for your kind responses

    i m trying this 

    =iif((Parameters!subreportHidden.Value.Equals("N")),False,True)

    but is not working.

    • Marked as answer by Miracle Systems Wednesday, September 12, 2012 3:52 PM
    • Unmarked as answer by Miracle Systems Wednesday, September 12, 2012 3:52 PM
    Tuesday, September 11, 2012 1:36 PM
  • Hi miracle,

    According to your description, I'd like to move this thread to Visual Studio Report Controls Forum for better support, where more experts live.
     
    Thanks for your understanding.


    Bob Shen [MSFT]
    MSDN Community Support | Feedback to us

    Monday, September 17, 2012 2:47 AM
  • Try to aply Ltrim and Rtrim at the parameter before you do that

    Tuesday, October 30, 2012 6:01 PM