When we deploy a report SSRS generates the following error:
There is an error on line 58 of custom code: [BC30201] Expression expected
However, the report works fine on preview mode and displays the field correctly.
The custom code segment here is also written and tested in visual studio.
Here's the custom code:
If (evaluationDate.Day = 31) Then '* affected line
returnValue.Append(String.Format("{0}{1:dd.MM}{2}", _
If(index = 2, " und ", String.Empty), _
New DateTime(evaluationDate.Year, evaluationDate.Month, lastDayOfMonthDictionary(evaluationDate.Month)), _
If(index = 2, ".", String.Empty)))
End If
As you can see, the problem is by an IF..THEN block. evaluationDate is of type DateTime and the value is either equal to the DateTime argument startdate
or six months ahead of startDate
- which is a datetime argument in the function's signature.
I cannot see what's wrong with this and I need to know what I can do to resolve this issue. Any ideas?
()
around the statement?If evaluationDate.Day = 31 Then
– Crosbyinvalid definition
. @NathanTuggy, I have written and tested this in Visual studio, when the date was 31 December onstartdate
and 6 months were added, the evaluation date was 30 June - that didn't cause issues. as I say, this error only happens during deployment. on Preview, it works correctly – Heidyexpression expected
. This is starting to confuse me xD – Heidy