หลายเดือนก่อน พี่ที่บ.เก่ามีปัญหาเกี่ยวกับ error ของ custom code ที่เขียนใน reporting service จำที่มันฟ้องไม่ได้ แต่สาเหตุก็คือ ภายใน code ของ custom code ไม่สามารถใส่ item ของโปรแกรม reporting service ได้
ตัวอย่าง
version ที่ผิด
Public Shared Function Test (Byval value As Integer)
If Value < 10 Then
Field!Show.Color = "red"
ElseIf Value > 10 Then
Field!Show.Color = "blue"
End If
End Function
= Code.Test(5)
version ที่ถูก (หละมั้ง :])
Public Shared Function Test (Byval value As Integer)
var color As String
If Value < 10 Then
color = "red"
ElseIf Value > 10 Then
color = "blue"
End If
End Function
= Field!Show.Color(Code.Test(5))