470,862 Members | 1,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,862 developers. It's quick & easy.

LocalReport: Object-in-Object as DataSource not working?

Hi,

I have a Report (VB.NET 2005), and I'm using Objects as DataSource.

I have the object objCompany, which contains a public property MyAdress
(instance of objAdress). objAdress has a propert Street.

When I add objCompany as a DataSource, I want to be able to show the
Street-property of MyAdress. So I do a drag-and-drop of that property from
the Data Sources - Window to the Report. Everything seems fine: I get a
textbox on my report with Value "=First(Fields!Street.Value,
"MyApplication_objCompany")".

But when I run the report, it doesn't show any value in it...

Does anybody knows why this happens? I somehow think because of the fact
that Street isn't directly on MyApplication_objCompany, but when I change it
into MyApplication_objCompany_MyAdress is complains about the fact that it
doesn't exist...

How should I do this?

Thanks a lot in advance,

Pieter
Jun 7 '06 #1
1 1561
I found the solution here for nested objects and reporting services
localreport in the reportviewer:

http://www.gotreportviewer.com/objec...ces/index.html

Apparently I have to do something like "=First(Fields!MyAdress.Value.Street,
"MyApplication_objCompany")".

It gave me these 2 errors:
The Value expression for the textbox 'Adresse' refers to the field
'ReportAdresse'.
Report item expressions can only refer to fields within the current data set
scope or, if inside an aggregate, the specified data set scope.

The Value expression for the textbox 'textbox19' has a scope parameter that
is not valid for an aggregate function.
The scope parameter must be set to a string constant that is equal to either
the name of a containing group, the name of a containing data region, or the
name of a data set.

But sddenly it started to work...
strange... :-/

"Pieter" <pi**********@hotmail.com> wrote in message
news:u6****************@TK2MSFTNGP02.phx.gbl...
Hi,

I have a Report (VB.NET 2005), and I'm using Objects as DataSource.

I have the object objCompany, which contains a public property MyAdress
(instance of objAdress). objAdress has a propert Street.

When I add objCompany as a DataSource, I want to be able to show the
Street-property of MyAdress. So I do a drag-and-drop of that property from
the Data Sources - Window to the Report. Everything seems fine: I get a
textbox on my report with Value "=First(Fields!Street.Value,
"MyApplication_objCompany")".

But when I run the report, it doesn't show any value in it...

Does anybody knows why this happens? I somehow think because of the fact
that Street isn't directly on MyApplication_objCompany, but when I change
it into MyApplication_objCompany_MyAdress is complains about the fact that
it doesn't exist...

How should I do this?

Thanks a lot in advance,

Pieter

Jun 8 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Andy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.