title: SSRS - Toggle subreports by parameter value
body: <p>Requirements are as follows:</p>
  
  <ul>
  <li>Grouping hierarchies should be swappable, for example  <code>Country &gt; City &gt; Department</code> and <code>Country &gt; Department &gt; City</code> can be selected by the end user.</li>
  <li>For the end user, there should be only one report.</li>
  <li>The hierarchy that the user wants can be selected in a parameter value.</li>
  <li>The data for the report should only be loaded once, since the query contains cpu intensive calculations.</li>
  </ul>
  
  <p>I'm trying to do this by adding subreports for each hierarchy. Since hidden subreports are automatically loaded, I cannot toggle visibility of multiple subreports, or the data will be loaded twice. The ReportName property of the Subreport does not allow expressions. Can I use custom code to solve this, or what is a viable solution?</p>