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

Problems with data binding

6 Answers 345 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark Bourland
Top achievements
Rank 1
Mark Bourland asked on 25 Jun 2007, 08:46 PM
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?

6 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 27 Jun 2007, 03:35 PM
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
0
Jason Monroe
Top achievements
Rank 1
answered on 12 Jul 2007, 06:18 AM
I'm having the same issue...

What's the resolution?
0
Svetoslav
Telerik team
answered on 12 Jul 2007, 02:41 PM
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
0
Vassil Petev
Telerik team
answered on 16 Jul 2007, 07:32 AM
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
0
Jason Monroe
Top achievements
Rank 1
answered on 23 Jul 2007, 10:36 PM
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 :)
0
Vassil Petev
Telerik team
answered on 24 Jul 2007, 09:21 AM
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
Tags
General Discussions
Asked by
Mark Bourland
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Jason Monroe
Top achievements
Rank 1
Svetoslav
Telerik team
Vassil Petev
Telerik team
Share this question
or