November 8, 2011 at 5:53 pm
Hi all,
I am using "code.matrixcellvalue" in my matrix in a report. this is the script:
=code.matrixcellvalue(
Count(Fields!emp_id.Value)
,avg(Fields!Age.Value)
,InScope("matrix1_emp_category") and InScope("matrix1_Age")
,"{0,6:N0}"
,"{0,6:N0}")
The problem is when I try to preview the report it comes up with this erro:
[rsCompilerErrorInExpression] The Value expression for the textbox ‘textbox3’ contains an error: [BC30451] Name 'code' is not declared.
What is strange is that I am using the exact code in another report and that report has no problem. The only difference is that the other report is in another solution.
Any suggestion?
November 8, 2011 at 6:08 pm
Well I found my answer
As "code.matrixcellvalue" is a custom It needs to add the following script to the
Report Property -> code
Public Function MatrixCellValue(ByVal sumValue As Object, ByVal avgValue As Object, ByVal InScope As Boolean, ByVal sumFormat As String, ByVal avgFormat As String) As Object
If InScope Then
Return sumValue
Else
If Not avgValue Is Nothing Then
Return String.Format(sumFormat, CDbl(sumValue)) + vbCrLf + String.Format(avgFormat, CDbl(avgValue))
Else
Return Nothing
End If
End If
End Function
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy