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

My Master->Detail report is not working

edited June 2003 in Subreports
My report has 2 TQuery, both data is generated from 1 stored procedure.

Query1 (pipeline1) contains the summary info. eg.
--------------------------------------------------------
RCode ACode WCode PType SQty FQty
20 A 223 BB 30 5
20 A 223 BC 20 3
20 A 223 RR 10 1
30 D 123 BB 25 2
30 D 123 RR 5 1
Order-> RCode,ACode,WCode,PType

Query2 (pipeline2) contains the details info. eg.
----------------------------------------------------------
RCode ACode WCode FType PType SQty FQty
20 A 223 XXX BB 30 5
20 A 223 XXX BC 10 1
20 A 223 XXX BC 10 2
20 A 223 YYY RR 10 1
30 D 123 XXX BB 10 1
30 D 123 XXX BB 15 1
30 D 123 ZZZ RR 5 1
Order-> RCode,ACode,WCode,FType,PType

I have link the Query2 to Query1 by setting the
MasterDataPipeline->pipeline1 and MasterFieldLinks->RCode,ACode,WCode. My
report structure is:-

GroupHeader1->RCode
GroupHeader2->ACode
GroupHeader3->WCode
Detail->PType,SQty,FQty
GroupFooter3->SubReport->GroupHeader1->FType

Detail->FType,PType,SQty,FQty
GroupFooter1->Total FQty
GroupFooter2
GroupFooter1

Result that I want:-
20 A 223
BB 30 5
BC 20 3
RR 10 1
XXX BB 30 5
XXX BC 10 1
XXX BC 10 2
-------
tot 8

YYY RR 10 1
-------
tot 1
30 D 123
BB 25 2
RR 5 1
XXX BB 10 1
XXX BB 15 1
-------
tot 2
ZZZ RR 5 1
-------
tot 1

But I get this result:-
20 A 223
BB 30 5
BC 20 3
RR 10 1
XXX BB 30 5
XXX BC 10 1
XXX BC 10 2
-------
tot 8
YYY RR 10 1
-------
tot 1
XXX BB 10 1
XXX BB 15 1
-------
tot 2
ZZZ RR 5 1
-------
tot 1

30 D 123
BB 25 2
RR 5 1
XXX BB 30 5
XXX BC 10 1
XXX BC 10 2
-------
tot 8
YYY RR 10 1
-------
tot 1
XXX BB 10 1
XXX BB 15 1
-------
tot 2
ZZZ RR 5 1
-------
tot 1

The result shows that each time when the sub-report prints, all the records
in Query2 is printed. I am using D7 and RB7. How to get the report prints
as the format that I want? Please help. Thank you.

Comments

  • edited June 2003
    Try simplifying the report and take the groups out of the picture. Place the
    detail subreport in the detail band of the main report and see if that
    works. You'll also need to be sure that the detail adataset is ordered the
    same as the master so that teh detail records can simply be traversed
    according to the linking field and the report can break master records
    correctly based on the linking field value in the detail dataset.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.