ReportViewer - accessing *second* object in object data source....

  • Thread starter Thread starter oliharvey
  • Start date Start date
O

oliharvey

....grrrr - this is driving me mad !!!!!

I have a number of addresses to display on my report.

my object data source is an "Address" business object.

I can bind a collection (list) of address - and pass these into a
report for tabulation - no problem.

I can also access the frist address in the report using the "First"
operator.

.......but I don't want to "tabulate" my addresses - I need to work
with them in a variety of ways and places.

I can find no way of getting at any other that the first address !
grrrr gnash gnash gnash

obviously if I invent some more "business objects" - eg:
HomeAddress
DeliveryAddress

.....then those can be difference ObjectDataSources - and I could work
with those no problem. But I don't want my report to dictate my object
model.

note - if I invent a new class just for passing data to the report -
then I can find no way of accessing properties that are not "top
level"- e.g. I can't do: datasource.HomeAddress.Postcode.Value

any help appreciated....
O.
 
...grrrr - this is driving me mad !!!!!

I have a number of addresses to display on my report.

my object data source is an "Address" business object.

I can bind a collection (list) of address - and pass these into a
report for tabulation - no problem.

I can also access the frist address in the report using the "First"
operator.

......but I don't want to "tabulate" my addresses - I need to work
with them in a variety of ways and places.

I can find no way of getting at any other that the first address !
grrrr gnash gnash gnash

obviously if I invent some more "business objects" - eg:
HomeAddress
DeliveryAddress

....then those can be difference ObjectDataSources - and I could work
with those no problem. But I don't want my report to dictate my object
model.

note - if I invent a new class just for passing data to the report -
then I can find no way of accessing properties that are not "top
level"- e.g. I can't do: datasource.HomeAddress.Postcode.Value

any help appreciated....
O.

Right, a report can be databound to Properties of an object. Not the
sub-properties of a property.

If you have a list like

<HomeAddress>
<BusinessAddress>
<PostalAddress>

You should add a flag field to each Address object to distinguish the
type of address (like a char 'H', 'B' or 'P'). Then use a filter
criteria on the different fields in your report to only show the
address where type = 'B' etc. Hope this is what you are after.
 
Back
Top