Security Error with Report Viewer Control and RDLC Reports in ASP.NET 4.0
Asked Answered
P

4

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?

Perla answered 14/11, 2011 at 21:1 Comment(0)
D
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.

Dorothi answered 9/3, 2012 at 20:52 Comment(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.Selfimprovement
T
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

Tying answered 10/1, 2014 at 2:41 Comment(1)
<Value>=Globals!PageNumber + " of " + Globals!TotalPages</Value> Use double quotes, not single quote. Just fixed this one.Crumbly
E
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".

Ethel answered 14/10, 2016 at 15:52 Comment(0)
B
0

It was a copy and paste error for me. More exactly, I missed a space.

This expression caused the error:

=Fields!CompSalesName.Value& vbcrlf & Fields!Address.Value

While it should have been

=Fields!CompSalesName.Value & vbcrlf & Fields!Address.Value
Bicollateral answered 28/11, 2023 at 23:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.