13

Using ASP.NET 4.0, I'm creating an RDLC stream by instantiating a Microsoft.ReportingServices.RdlObjectModel.Report, setting the Code property, and returning the stream using the RdlSerializer.

Then I'm passing that stream to the ReportViewer like so:

ReportViewer1.LocalReport.LoadReportDefinition(rdlcStream);

If I don't set the Code property, I don't get any errors and the report displays properly, but when I set the Code property for a report that needs custom code, I get the below mentioned 'RequestMinimum' is obsolete error.

An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC40000] 'RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'.’.

This error doesn't occur using the Report Viewer control in a winforms app.

Has anyone seen/resolved this issue?

Otiel
  • 18,404
  • 16
  • 78
  • 126
jskentzos
  • 141
  • 1
  • 1
  • 4

3 Answers3

7

I do not know exactly the cause of this error, but in my experience, it was related with a simple copy and past from a expression from one cell to other cell inside the results table, all this after making changes in the layout and groups.

I recommend you delete any expression or formula, verify that your report is executed without any error message, and rewrite down all the expressions and formulas one to one, checking in every formula that your report open correctly.

That worked for me.

Fidel Orozco
  • 998
  • 11
  • 19
  • 1
    +1 I had the same error when copying from SSRS rdl to local rdlc. I had to delete all expressions (keeping grouping, labels) and then recreate them. Not sure what exact statement it didn't like, but I've had this twice now and this is what I had to do. – Andrew Grothe Feb 28 '13 at 14:17
1

For me it was the page number in this line
<Value>=Globals!PageNumber + ' of ' + Globals!TotalPages</Value>
When removed everything goes right and i don't know why

MrBassam
  • 349
  • 1
  • 5
  • 17
  • =Globals!PageNumber + " of " + Globals!TotalPages Use double quotes, not single quote. Just fixed this one. – ian_scho Oct 20 '22 at 10:40
0

Another option for those got this error and generate report markup.

Likely one of you <Value> tags starts with "=" sign and if this is not an expression you need to use EvaluationMode="Constant".

Baidaly
  • 1,829
  • 1
  • 15
  • 16