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

Detai DataPipeline does not traverse with MasterDataPipeline/MasterFieldLinks relation for TppVariab

edited October 2003 in General
Hi,

I have a problem using the masterdatapipeline with variable in RAP.

I dropped two TDatasource objects, two TClientDataSet objects and two
TppDBPipeline objects and link up as master detail relationship using
TppDBPipeline's MasterDataPipeline and MasterFieldLinks. The Detail
ClientDataSet has index setup. I didn't use the MasterSource and
MasterFields to form the master detail relationship.

Basically, it works fine for all the situations in master/detail
relationship in report builder for the above setting. I use subreport to
the detail records. Everything just works fine except one situation:

I drop a TppVariable component on the report designer in the main report and
the following code in OnCalc:

Value := DBPipeline2['OrderNo']; // DBPipeline2 is the detail pipeline

I want the main report shows only the value of a value of the first row of
the detail dataset and thus I don't drop any subreport here.

There are two situations here:

1. If THERE ARE any TppDB component on the main report link to Detail
DBPipeline, the ppVariable show the value I want which is the OrderNo of the
first row of the detail dataset.

2. If THERE IS NO TppDB component on the main report link to Detail
DBPipeline, the ppVariable didn't show the value I want. It only shows the
same value for all the master rows without traversing the detail pipeline.

Perhaps it is hard to imagine what I describe, I have an example here:

Master Table:

CustNo CompanyName
1221 Kauai Dive Shoppe
1231 Unisco
1351 Sight Diver
1354 CayMan Divers

Detail Table:

CustNo OrderNo
1221 1269
1221 1270
1221 1271
1221 1340
1231 1341
1231 1345
1351 1400
1351 1495
1354 4833
1354 4999


The main report's layout is as follow (no subreport):

+--------+ +-------------+ +-----------+
| CustNo | | CompanyName | | ppVariable|
+--------+ +-------------+ +-----------+


For case 1, the output is

1221 Kauai Dive Shoppe 1269
1231 Unisco 1341
1351 Sight Diver 1400
1354 CayMan Divers 4999


For case 2, the output is

1221 Kauai Dive Shoppe 1269
1231 Unisco 1269
1351 Sight Diver 1269
1354 CayMan Divers 1269


Please note the value of ppVariable column for the two situation is
different. I want the output of case 1 but I wish to use the approach of
case 2 as I don't want to drop any TppDB component for detail pipeline.
Should there be any events or any properties to set for the pipelines? I
suspect the detail pipline aren't traverse at all for case 2. Although
setting the mastersource/masterfields solve the problem, but I have my own
reason of not to use this approach. I perfer the
MasterDataPipeline/MasterFieldLinks as master/detail relationship for the
case.


Please advice. Thank you.

Regards,
Tony

Comments

  • edited October 2003
    Hi Tony,

    If you do not have your detail dataset linked to anything, the ReportBuilder
    will not traverse that data. The only way I can see around this issue would
    be to create a subreport that is connected to your detail data and place
    that next to the master records. This will still only just be a straight
    traversal so it will be hard to display the correct order numbers for each
    customer. The easiest way to solve this problem would be to create one
    dataset with all the information you need in order using a single query then
    displaying the data without any linking at all.

    --
    Best Regards,

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