Problems with data binding

7 posts, 0 answers
  1. Mark Bourland
    Mark Bourland avatar
    7 posts
    Member since:
    Jan 2007

    Posted 25 Jun 2007 Link to this post

    Hello,

    I am using the Telerik report viewer for ASP.NET.  I have a DataSet object (.xsd) that I use as the data schema for my report at design time.  At runtime, I fill that DataSet via code and bind it to the report (ResumeReport is my Telerik.Reporting.Report that I'm designing):

    ResumeReport report = new ResumeReport();
    report.DataSource = dataSet;
    report.DataMember = "Users";
    reportViewer.Report = report;
    reportViewer.DataBind();

    I have stepped through the code in debug mode and have verified that the DataSet is populated with data.  I get no build errors, but when the report tries to display, I get:

    "The expression contains object 'FirstName' that is not defined in the current context."

    "FirstName" is a field in the "Users" table of the DataSet.  I used the DataExplorer to drag the "FirstName" field on to the report, so it is just a TextBox with the value of "=FirstName".  The FirstName text box is in the Details section of the report.

    What am I doing wrong?

  2. Hrisi
    Admin
    Hrisi avatar
    221 posts

    Posted 27 Jun 2007 Link to this post

    Hi Mark,

    Your questions has been addressed in the support ticket you have opened on the topic. Feel free to reply there, if further assistance is needed.


    Kind regards,
    Hrisi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
  4. Jason Monroe
    Jason Monroe avatar
    4 posts
    Member since:
    May 2006

    Posted 12 Jul 2007 Link to this post

    I'm having the same issue...

    What's the resolution?
  5. Svetoslav
    Admin
    Svetoslav avatar
    649 posts

    Posted 12 Jul 2007 Link to this post

    Hi Jason Monroe,

    We need some more information about your problem and if possible send us your report so we be able to reproduce and identify the issue.

    Regards,
    Svetoslav
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 16 Jul 2007 Link to this post

    Hello Jason,

    A quick followup. We were not able to reproduce Mark's problem, so we requested his project. It turned out that he was able to solve the issue by breaking up the code to fill the dataset into separate parts.

    When he was setting the datasource for the report, he was also setting the datasource for all of its subreports, since they were using different tables within the DataSet object.  When he moved the code to set the datasource for the subreports to the NeedDataSource methods for the subreports, it worked fine.

    If this does not work for you, please open a support ticket and send us your project so that we can review it.


    Greetings,
    Rob
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Jason Monroe
    Jason Monroe avatar
    4 posts
    Member since:
    May 2006

    Posted 23 Jul 2007 Link to this post

    My problem was actually a bit differant.

    On my report, I had an image box that was unbound to a data item.  The erorr was being thrown when the report tried to render the image box, with no source image supplied.

    Once I set the source image via created property, everything was alright.  Of course, the root of the problem is that the error message had nothing to do with the origional problem.  But chalking that up to beta software, I managed my work around and continued on :)
  8. Vassil Petev
    Admin
    Vassil Petev avatar
    1765 posts

    Posted 24 Jul 2007 Link to this post

    Hello Jason,

    Jason, we are glad to hear that you managed to solve the problem. THank you for sharing your findings in the Forum.
      
    FYI, we are working on better error messaging, because we understand that they are a little vague. Stay tuned for further development on this topic for the September release.


    All the best,
    Rob
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
DevCraft banner