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:

SSRS Code not declaredSo, 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:

SSRS Custom Code reporting services

I hope this helps if you run into this SSRS error.

Advertisements

Thank this author by sharing the article on social media. If you have any questions or comments, please leave a reply below:

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s