Skip to Content
Former Member
Nov 19, 2010 at 12:01 PM

The field name is not known - issue with subreport


Hi All,

I'm having a problem with a simple report which I hope someone can shed some light on. Details of my development platform are:

Windows 7 Professional 64-bit client

Oracle 11g Database

Crystal Reports v11 R2 with SP4 (v11.5.10.1263)

Visual Studio .NET 2005 SP2 (v8.0.50727.867)

I have created a very simple report (no sub reports) in the CR Designer based on three tables in a development database. I'm using OLE DB (ADO) as the connection method. The report works as expected in preview mode in the CR designer. I then add the report to a Visual Studio.NET (VB) project and again the report performs as expected when connected to the development database. I have code in the application to change the login information of the underlying report tables and this works as expected - when the application is connected to the production database, the report, again, works fine.

However, when I add a simple sub report, I'm having a problem. The sub report is linked to the main report via a parameter field. In the CR Designer, the reports works fine against both the development and production databases. When the report is incorporated into the VB.NET application, the report works fine when connected against the development database. However, when the application is connected to the production database I get the following error:

"Error in formula <Record Selection>.

'{MEMBERS.CODE} = {?p_members_code}'

The field name is not known.

I've been unable to resolve this issue after considerable investigation. What I have discovered so far:

1. If the report is opened in CR Designer and previewed I'm prompted to enter the connection details for the data source as expected. If I choose the production database the report previews as normal. When I save the report and incorporate it back into the application - the report works fine when connected against the production database but produces the same error when connected against the development database.

2. The development database is a copy of production so tables are similar on both instances. I have confirmed this in Oracle and the "Verify Database" function in the CR Designer confirms same.

3. Hard-coding a value for the parameter {?p_members_code} in the VB.NET code does not resolve the issue

4. Remove the sub report and all is well

Would be grateful for any assistance offered....Thanks.