Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
oliharvey@googlemail.com - 22 Feb 2007 14:36 GMT
...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.
mangist@gmail.com - 23 Feb 2007 04:05 GMT
On Feb 22, 9:36 am, olihar...@googlemail.com wrote:
> ...grrrr - this is driving me mad !!!!!
>
[quoted text clipped - 28 lines]
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.