SSRS Subreport Execute and Visibility/Hidden Syntax

Answered SSRS Subreport Execute and Visibility/Hidden Syntax

  • Wednesday, February 13, 2013 4:12 PM
     
     

    Three questions from a newbie in SSRS...

    1.) I have multiple sub-reports within my main report. I would like the execution of these sub-reports to depend on the parameter provided in the Main Report...1 to Run Report 1...2 to Run Report 2...etc...Within Subreport Properties, can I provide an expression that utilizes my Main Report "ReportRequest" to determine whether or not to run each sub-report and what is that syntax? I tried =Parameters!ReportRequest.Value=1 or 3 and it doesn't seem to like that.

     2.) Within my Sub-Report and Subreport Properties, I am trying to control visibility as well. So the expression I have for "Hidden" is =Parameters!ReportRequest.Value=2 or 4...but I think that syntax is wrong. Can someone help me with the syntax?

    3.) Within Subreport Properties, it says "Set expression for: Hidden"...Can I instead use an expression for "Show" because it says "Show or hide based on an expression"...Soooo how do I toggle from "Hidden" to "Show"???

    Thanks for your review and am hopeful for a reply.

    PSULionRP

All Replies

  • Thursday, February 14, 2013 9:02 AM
    Moderator
     
     Answered

    Hi Psul,

    For the subreport1 use the expression below to set the visibility of it:
    =iif(instr(join(parameters!ReportParameter1.Value,""),"1")>0,false,true)

    For the subreport2 use the expression below to set the visibility of it:
    =iif(instr(join(parameters!ReportParameter1.Value,""),"2")>0,false,true)

    For the subreport3 use the expression below to set the visibility of it:
    =iif(instr(join(parameters!ReportParameter1.Value,""),"3")>0,false,true)
    ……

    If you have any questions, please feel free to ask.

    Regards,


    Charlie Liao
    TechNet Community Support