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

JIT pipeline master detail

edited July 2005 in General
Hi

I have a problem with a report that uses two JIT pipelines in a master
detail relationship.

Version 7.02, Delphi 6 up2

The master table is ordered by column 1 and joined to the detail by column
2. The report is grouped by column 2. If the column2 figures do not rise
consistently all the detail data remains attached to a value until the next
higher one is found eg. . . . .

Column1 Column2
A 1
B 2
C 3 all is OK to here
D 9 this group contains all the data for
9,4,6
E 4 this group is empty
F 6 this group is empty
G 10 this one is OK

The data is contained it TLists and I have checked that the detail data has
the correct reference values. If I order the data by column2 all is well.

Any ideas?

Regards
Paul

Comments

  • edited July 2005
    Hi Paul,

    Be sure your detail data is ordered by the Column2 data. Take a look at
    demo 139 located in the \RBuilder\Demos\1. Reports\... directory
    (dm0139.pas). This will give you a good idea about what needs to be done to
    create a master detail report using JIT Pipelines.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Hi Nico

    Thanks for the prompt reply. I think I know how to use JIT pipelines -
    I've been at it for some years now ;-)

    I just never had the problem before where the details table is not in
    reference field order.

    I am surprised that this is a requirement. Wouldn't it be better if it
    filtered the records regardless of what order they are in?

    I created the master detail lists from one query which returned rows in
    column1,column2 order. I create a header then detail records for that
    header until column1 changed and so on to the next header. The detail
    records are therefore in blocks in column1, column2, column3 order - to
    write a routine to then sort this by column2,column3 order just so the
    master detail link works doesn't seem reasonable.

    Also data aware master detail relationships do not require this ordering.

    If you slightly agree with me could you raise this for consideration for
    future development?

    Regards
    Paul


  • edited July 2005
    Hi Paul,

    ReportBuilder simply traverses the data you give it as-is. There is no "in
    house" sorting or caching being done when a report is generated. This is
    true for data aware master detail relationships as well. In order for a
    Master Detail relationship to work correctly in ReportBuilder regardless the
    datasource, the detail dataset will need to be sorted on the linking field.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited July 2005
    Hi Nico

    Unless we are talking at cross purposes I am surprised by what you are
    saying -.

    If I have a master query like select account_no, name, etc from customer
    order by name
    and a detail query like select order_number,account_no from orders

    are you saying that unless the detail query has 'order by account_no' that
    report builder will fail?

    I dont think so and just connecting grids to the queries will prove it.
    The detail will either refresh from the server with 'where
    account_no=master_account_no' or it will filter the result set to only show
    the results for the master account_no - ordering has nothing to do with it?

    Regards
    Paul

  • edited July 2005
    Hi Paul,


    Sorry, I didn't explain myself fully. When using DataPipeline Linking in a
    Master-Detail relationship, as you will when connecting JITPipelines, you
    will need to sort the detail data on the linking field. When connecting
    datasets using parameters or master datasources, it is the Delphi objects
    that are sorting the data for you, not ReportBuilder.

    In example 139 you will notice that the JITPipelines are linked in a
    Master-Detail relationship. If you view the Orders.txt you will see that it
    is ordered on the CustNo field.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.