Field not found in current context

3 posts, 0 answers
  1. Larkin Young
    Larkin Young avatar
    141 posts
    Member since:
    Feb 2005

    Posted 17 Jan 2008 Link to this post

    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??


  2. Chavdar
    Chavdar avatar
    898 posts

    Posted 17 Jan 2008 Link to this post

    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.

    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Angie
    Angie avatar
    109 posts
    Member since:
    Jan 2008

    Posted 27 Mar 2008 Link to this post

    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.


    Edit:  Nevermind, I figured out how to do it by grouping the report.  Thanks.
Back to Top