Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

Two masters, one detail

edited January 2007 in End User
I'm having a problem working out how to do the following - any help
appreciated.


I have a table of people (A), and a table of possible achievements (B). I
have another table (C) which has an entry only if person from A gets an
achievement from B, which has 'A Index' and 'B index' and the date of the
achievement.

I want to print a list of all the people from A that meet specific
criteria, then for each of them have a list of all possible achievements
as well as showing the date of the ones they have, for example:

Person 1
Achievement 1
Achievement 2
Achievement 3 Date awarded
Achievement 4
Achievement 5
Person 2
etc...

it's the how to get the 'date awarded' above showing that I'm having a
problem with.

Thanks

--
Jeremy Knowles

Comments

  • edited January 2007

    - define linking relationships from B to A and from C to B.

    - for each linking relationship you need to specify that you want the master
    records included even when no corresponding detail records exists. If you
    are using the RB Data workspace, you can do this via the Link Dialog. Access
    the Link Dialog by double-clicking the visual link. (Or position the mouse
    over the detail query and press the right mouse and select the option from
    the context menu).


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2007

    For the Report layout create a main report and subreport. In the subreport
    layout, you can connect the relevant DBText to DataPipeline rather than B

    main - A
    subreport - B
    dbText(B) dbText(C)

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2007
    Nard Moseley (Digital Metaphors) wrote:


    Yes, but the point is that I also have C to A as well as C to B and the
    linking can only do one link.

    --
    Jeremy Knowles
  • edited January 2007

    - the Link dialog can be used to specify more than one field for the linking
    relationship. However, it is true that the fields must belong to the same
    master query.

    - Perhaps you need to join B to A so that you have a query that contains the
    two fields upon which C can link to a master.

    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited January 2007
    Nard Moseley (Digital Metaphors) wrote:


    I can't really join B to A because B is just a list of descriptions that I
    want to display alongside each person, whether or not thy have an entry in
    table C.

    --
    Jeremy Knowles
  • edited January 2007
    Any other suggestions?


    --
    Jeremy Knowles
  • edited January 2007

    I re-read the original post to try to understand better.

    I am now thinking that perhaps you need to do a cartesian product on Person
    and Achievment (by cartesian product I mean a join between two tables
    without a join condition specified so that for each Person gets repeated for
    all rows in Achievement). The RB Query Designer does not support doing such
    a join, but you could type it manually. Order the data by Person and
    Achivement. Then you could link the C to the master query. You would need
    to programmtically define the links between the two pipelines. There is
    DBPipeline.AddLink method that can be used to add links. Call AddLink twice,
    once for each field that you want to link (personId, AchivementId). You will
    want to order the detail data by the linking fields.


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.