title: SSRS '08 System.Security.Permissions.SecurityPermission ERROR
body: <p>I'm getting a rather frustrating error from Business Intelligence Development Studio (Visual Studio 2008). I have a report that contains 4 sub-reports, these sub-reports may or may not contain data, and as such their HIDDEN property is controlled by an expression:</p>
  
  <pre><code>=IIF(ReportItems![SOME TEXT BOX].Value = 0, TRUE, FALSE)
  </code></pre>
  
  <p>The contents of [SOME TEXT BOX] is the number of rows returned by the stored procedure for its respective sub-report, thus if the value is 0, then the rectangle containing the sub-report is set to HIDDEN = TRUE.</p>
  
  <p>This works for 3 of the 4 sub-reports, but for some reason, one of them causes this error:</p>
  
  <blockquote>
    <p>The hidden expression for [RECTANGLE CONTAINING SUB-REPORT] contains an error:<br>
        Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib,
        Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed</p>
  </blockquote>
  
  <p>Some Googling reveals that this is (clearly) to do with access permissions, but most people seem to be experiencing the error in relation to MS Sharepoint, and the solutions do not seem applicable.</p>
  
  <p>Any help would be most appreciated!</p>
  
  <p>Brian</p>
  
  <p>Edit: This only occurs when 'ReportItems![SOME TEXT BOX].Value = 0' returns TRUE, i.e. there are no rows.</p>