SSRS '08 System.Security.Permissions.SecurityPermission ERROR

permissions, reporting-services, visual-studio-2008

Solution

OK, so I've found the real cause of this problem; Microsoft, and their unhelpful error messages! But seriously I was getting this error because I was passing a NULL value.

Assuming you've read my initial question, the dataset that was getting the NULL was the one that populates [SOME TEXT BOX], but the NULL was not in the field that populates [SOME TEXT BOX]. A bit round the houses but I've got there in the end!

Problem

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: ``` =IIF(ReportItems![SOME TEXT BOX].Value = 0, TRUE, FALSE) ``` 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. This works for 3 of the 4 sub-reports, but for some reason, one of them causes this error: The hidden expression for [RECTANGLE CONTAINING SUB-REPORT] contains an error: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed 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. Any help would be most appreciated! Brian Edit: This only occurs when 'ReportItems![SOME TEXT BOX].Value = 0' returns TRUE, i.e. there are no rows.

Original source