×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Crystal Report Viewer "This field name is not known."

Crystal Report Viewer "This field name is not known."

Crystal Report Viewer "This field name is not known."

(OP)
When trying to view a report using VB6 and the crviewer.dll it lets the report prompt for parameters and then gets stuck with an error message box titled "Crystal Report Viewer" and the error is "This field name is not known." This happens only with a couple of my reports and I can't see the difference between these and the other reports that I can view with no problem in crviewer.

I can run the problem reports in the Crystal Reports designer software with no error. I tried editing each formula and checking for errors, finding none. I even tried deleting all the formulas and trying to run the report from VB -- same error. Do I have to start with a new blank report and rebuild it piece by piece? Is there any better way to get crviewer to reveal what field name is not known?

Here is a simplified example of the code that works for most, but not all of my reports.
Private Sub Form_Load()
Dim crxApplication As New CRAXDRT.Application
Dim Report As CRAXDRT.Report
Set Report = crxApplication.OpenReport _
("p:\bhisrpts\HB-FOR-006.rpt")
Report.Database.Tables.Item(1).SetLogOnInfo "MyDSS", , "MyUser", "MyPassword"
CRViewer1.ReportSource = Report
CRViewer1.ViewReport
End Sub

RE: Crystal Report Viewer "This field name is not known."

Do a verify database on the faulty reports.  It sounds like your DB has changed since the rpt was developed.

Editor and Publisher of Crystal Clear
www.chelseatech.co.nz/pubs.htm

RE: Crystal Report Viewer "This field name is not known."

(OP)
Good suggestion. I verified the database (an Oracle stored procedure) but still got the same result. To make sure it really was verifying I changed the name of the procedure, added a dummy field to the procedure, did a set location for the report, saved it - everything I could think of to make sure it was in synch with the database. It still runs OK in CR but not in CRviewer. Thanks anyway.

RE: Crystal Report Viewer "This field name is not known."

(OP)
OK. I finally found the problem by deleting each field, formula and running total in the report, one by one, until the report would finally run in crviewer. It turns out the culprit was a conditionally suppressed running total that was no longer used in the report. The formula that conditioned whether to suppress this unused running total refered to a field that was no longer in the underlying stored procedure for the report. This error wasn't detected when running the report in the CR designer, nor by doing a "verify database" because the field was no longer really used by the report. However, crviewer could not get past it and kept stopping with the very uninformative message "This field name is not known", which kind of begged the question "What field name is not known?" So now I know.

RE: Crystal Report Viewer "This field name is not known."

I have the same problem with you. And I wonder why the error still the same when there is no field that was not used, I meant every field is used.

I runs well when there is no more selection formula in the report. And I need this selection formula.

Do you have a better explanation and problem solving ?

RE: Crystal Report Viewer "This field name is not known."

Please post your formula and indicate the location of the cursor or which field name is not known.

Also, does your formula use an user defined functions?  These functions are typically available via a third party .dll that needs to be registered.  NumbertoDate() is an example of a third party UFL.  If the .dll is not registered, crystal will not recognize this as a function and will return the error "field name not known" when it encouters your UFL.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
www.trianglepartners.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close