locked
ReportViewer : how to bind two tables with the same type of object but not from the same list? RRS feed

  • Question

  • Hi everybody,

    I'am trying to work with the crystal report embeded tools in VS2005.

    I've a object (SessionControlReport) which contains these properties:

    StartDate (DateTime),
    EndDate (DateTime),
    AttributedSessions (List<SessionItem>)
    NotAttributedSession (List<SessionItem>)


    SessionItem is a class in which I've defined some fields like PaymentAmount and so on ( actually, value types)

    SessionControlReport is the object i use to show in my report.

    In my report (report1.rdlc), i would like to show two tables. One for the AttributedSessions property, and the other for the NotAttributedSessions property. Also, i would like to show the field StartDate and EndDate of the SessionControlReport object.

    But, as the two lists contains the same type of object (SessionItem), it create only two DataSet in the Report (file report.rdlc),
    Visual studio 2005 only creates two dataset (one for the SessionControlReport class and one for the SessionItem Class)

    The problem appears when i want to bind my two object list two the reportviewer. As I have only two bindingsource (one for SessionControlReport and one for SessionItem), i can't say that the second table has different datas from the the first.

    I would like to think this is not a limitation two the crystal report tool in VS2005 because i doesn't want to define my own collection (which causes the creation of new datasets I think). (because this would like represent a unnecessary amount of class that I doesn't want to create.

    So, is there a mean to create two dataset for the same type of object which are contains in two different properties of the same parent object?

    Can you please tell me how i've to do with it?

    I Would like to stay in the domain of model object (then no use of dataSet, no use of datatable and so on).

    Thanks a lot to all in advance.


    Mike



    Wednesday, October 1, 2008 2:14 PM

Answers