Disclaimer:

These are my personal views and are meant for Informational purpose only. Please verify the Information via Professional help or via Official references before acting upon the information provided in this Blog.

SSRS Error: “The value expression for the … contains an error. [BC30451] ‘code’ is not declared”

Standard

I was working on some enhancements on an existing SQL Server Reporting Services (SSRS) report & so before started adding enhancements to the report, I made a copy of the existing report. And after that, I tried running the report as-is to make sure everything was functioning as it should. But I got an error:

So, when you get an error like this, look for missing custom code in the SSRS report.

If you look at the expression which is throwing the error, you’ll see something like code.<custom function> in the expression.

To solve the error, you’ll have to define the custom function for your report. In my case, I had to copy the code from the existing report to the new version of report that I was working on.

To do that, follow the steps:

Design View > Right click on the surface outside the border of the report > Report Properties > Code: