0
votes

Net 2010 to run crystal reports 11 and I am getting This field name not found error when I use any table value in the formula field. I am trying to check a date field isNull or not and then picking the non null value from the database/view field. If I build as a report in Crystal Reports 11 stand alone it works. But with CrystalReportViewer in VB .Net 2010 I am getting this error. This field name is not known.Error in formula ..... Details: errorKind

This is my Vb code inside the formula section.

Dim x as date

If {@PI} = "PI" Then
    x = DateValue({VIEW_GROUP_TOTALS.CH_PI_OPEN_DATE})
else
    If IsNull({VIEW_GROUP_TOTALS.CH_OPEN_DATE}) Then
        x = DateValue({VIEW_GROUP_TOTALS.CH_PI_OPEN_DATE})
    else
        x = DateValue({VIEW_GROUP_TOTALS.CH_OPEN_DATE})
    End If
End If

formula = x

Basically I cannot get any field value inside the formula section. Any help is much appreciated.

Thank you, Ravin ![enter image description here][1]

1
Why I am not able to use any field value inside a formula section. The standalone report works well but with Vb .net it fails. All other crystal Thank you - Ravrav
have you checked the database connection? Do verify database and check what is the result?Siva
Yes I have verified the database connection. In fact I am getting the field names as a drop down. The same code works fine in another report but it is pointing to another view from the same server. - Thank yourav

1 Answers

0
votes

The issue has been fixed. The fix was ... I was not getting the field value which I was validating inside the formula. That is the sql which queries the view did not has the field name in the sql. When I modified the SQL by adding the field name, I did not get that error from the formula section.

Thank you Siva - it was a SQL query issue your clue helped me to fix the issue.