This is a migrated thread and some comments may be shown as answers.

Field not found in current context

2 Answers 437 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Larkin Young
Top achievements
Rank 2
Larkin Young asked on 17 Jan 2008, 10:43 AM
I am using Q3 2007 SP1, and I am getting a frustrating error when I view a report I've created. Here is my scenario:

  1. Created a new typed dataset and set it as the datasource in the report designer; also set the datamember to the appropriate table
  2. Added 2 textbox items to the report header section and set the expressions to fields that I selected in the expression editor dialog
  3. Added a new webform containing the reportviewer control; in the codebehind (Page_Load) I add code that creates an exact duplicate of the dataset (reading from same schema file that I used to create the typed dataset) and created a few sample datarows
  4. Viewed the report and I get the following error:

#ERROR# The expression contains object 'BankEmployeeName_A' that is not defined in the current context.  

Why doesn't it find the field? I set a breakpoint in the ItemDataBinding event handler and the report's datasource property does in fact contain this field within the targeted datamember (datatable). Am I missing something?

I am only using the typed dataset for design-time--I will be returning the exact same result set from an Oracle stored procedure and I don't want to use typed datasets for this purpose. Theoretically, this scenario should work perfectly, and in fact, is the way in which we were binding all of our Crystal Reports report objects previously.

Any ideas on why this isn't working??

Thanks,
Larkin

2 Answers, 1 is accepted

Sort by
0
Chavdar
Telerik team
answered on 17 Jan 2008, 02:59 PM
Hi Larkin Young,

Unfortunately, it is not allowed to reference a data source field in an expression of items that reside in the Page Header or footer section. For more information on the Report processing life cycle please refer to this help topic.

I hope this information helps. Please, let me know if I can assist you any further.

Greetings,
Chavdar
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Angie
Top achievements
Rank 1
answered on 27 Mar 2008, 05:11 PM
Is there a work around for this or some other way to provide a dynamic header for the report?  I am creating a report that can be run for any advertiser, and therefore must be able to display the advertiser name at the top of the report.

Thanks!



Edit:  Nevermind, I figured out how to do it by grouping the report.  Thanks.
Tags
General Discussions
Asked by
Larkin Young
Top achievements
Rank 2
Answers by
Chavdar
Telerik team
Angie
Top achievements
Rank 1
Share this question
or