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

Losing details

edited February 2007 in Subreports
Hi,

This is my situation:

I have a master details relationship.

Master Sample data:

ID_1, ID_2, Master_Value
001 1 header 1
001 2 header 2


Details Sample data:

ID_1, ID_2, Details_Value
001 1 details 1
001 2 details 2


Report grouping:

Group[0] is on ID_1 < this should show header n>
Group[1] is on ID_2 < this will show detail n>

in the details datapipe if I set the masterfieldlinks to ID_1 only, then
this is what the report generates

page1:

header 1
details 1
details 2

page 2:

header 1
details 1
details 2

this is not what I want.

I want to generate the report in this format

page 1:

header 1
details 1

page 2:

header 2
details 2.

when I set the masterfieldlinks fields to be on both ID_1 and ID_2, this is
what I get

page 1:

header1
< the details section appears briefly and then disappears>

page 2:

header 2


The details dataset is return from a MS SQL Server stored procedure and
ordered by ID_1, and ID_2.

I have other sub-reports on the same report which are working fine. The only
difference I noticed if when the ADOStoredProc is openned, the lock type is
optimistic for those subreports that work, and is batchOptimisctic for the
one that does not.

Everything else appears to be identical.

Help!!!

Thanks in advance, Gary.

Comments

  • edited February 2007
    Hi Gary,

    In order to get the output that you want, you will need to only link on the
    ID_2 field. Linking on the ID_1 field will always return all the detail
    records since they are the same value. Take a look at the Master-Detail
    demos located in the \RBuilder\Demos\1. Reports\... directory. You will
    notice that these use the Customers/Orders tables and only link 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
  • edited February 2007
    Hi Nico,

    This is really "weird", I was using a stored proc to retrieve data from a
    SQL Server 2000 database. Now instead of linking TADOStoredProc to a
    TDataSource and then to a TDBPipeline, if I load the data into a
    TKBInMemTable then everything works fine.

    Cheers, Gary.

This discussion has been closed.