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

Strange subreport behaviour

edited November 2008 in General
Hi,

I'm using two linked datasets(Main and Sub)and using them for the report and
its subreport. Both datasets contain CustIDs and ProdIDs and the sets are
linked using CustID.

I am using sort: Main: CustID, ProdID;
Sub: ProdID

The subreport is put in the CustIDgroup footer and for some customers the
subreport will not print (and when i check the CustID link is NULL for the
last rows of the main detail band)

When I put the subreport in the groupheader band everything is working.

OR

If I remove the ProdID sort of the Main dataset - everything works.

What am I missing here?

Thanks for all help.

Hans

Comments

  • edited November 2008
    Hi Hans,

    For a master detail report, you need to be sure you are sorting the detail
    dataset on the linking field first. This way for each master record, the
    engine can find every detail associated with it.

    http://www.digital-metaphors.com/rbWiki/Data_Access/Fundamentals/Data_Traversal

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2008
    This I have done, but still get the strange behaviour.
    Even if I change the range of records, it is still just the one record which
    dont print the subreport. All other.
    And as I said, if I move the subreport to the header band it prints for all
    records.

    Hans (btw thanks for quick replies)

  • edited November 2008
    Hi Hans,

    Which version of ReportBuilder and Delphi are you using?

    I created a quick test application using the customer and orders tables in
    the DBDEMOS database here and was able to successfully see all details for
    each master when the subreport was placed in the group footer. If possible,
    please send a minimal example I can run on my machine that demonstrates the
    issue to support@digital-metaphors.com in .zip format and I'll take a look
    at it for you.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2008
    Hi Nico,

    Iam using RAP and RB 7.02 (and Delphi 6) for this customer.

    I finaly managed to make the report calculate properly and showing all data
    for all instances. I rewrote the report and made sure that all datasets
    where linked correctly and sorted accordingly. It now works.

    Thank you for your help.
    Hans

This discussion has been closed.