Forum Discussion
error: [BC30451] - paginated report
error: [BC30451] "Code" is not declared. - thats my error code in the paginated report. How can i declare the variable? I have to copy the paginated reports from the old software to the new one. It worked so far at the old software from Microsoft.
Thanks for help.
The variable called Code.
Hi, Maaaaaaaax
The error BC30451 means that you are trying to use a variable or a class that is not declared or not accessible in your code. To fix this, you need to make sure that you have declared the variable or the class with the correct scope and visibility, and that you have imported the necessary namespaces or assemblies.
One possible cause of this error is that you are using a custom code block in your report definition, and you have not declared the Code variable. The Code variable is a special variable that represents the custom code block, and it must be declared as Public Shared in the report properties. For example:
Public Shared Function GetTotal (ByVal value As Decimal) As Decimal Return value * 1.1 End Function
To declare the Code variable, open the Report Properties dialog box, click References, and add the following line in the Declarations section:
Public Shared Code As Object
This will allow you to use the Code variable in your expressions, such as =Code.GetTotal (Fields!Sales.Value).
For more information on how to use custom code in paginated reports, please refer to this article.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-zhangtiCommunity Support
Hi, Maaaaaaaax
The error BC30451 means that you are trying to use a variable or a class that is not declared or not accessible in your code. To fix this, you need to make sure that you have declared the variable or the class with the correct scope and visibility, and that you have imported the necessary namespaces or assemblies.
One possible cause of this error is that you are using a custom code block in your report definition, and you have not declared the Code variable. The Code variable is a special variable that represents the custom code block, and it must be declared as Public Shared in the report properties. For example:
Public Shared Function GetTotal (ByVal value As Decimal) As Decimal Return value * 1.1 End Function
To declare the Code variable, open the Report Properties dialog box, click References, and add the following line in the Declarations section:
Public Shared Code As Object
This will allow you to use the Code variable in your expressions, such as =Code.GetTotal (Fields!Sales.Value).
For more information on how to use custom code in paginated reports, please refer to this article.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.