Master/detail (one-to-one) without subreport?
Do I need to use a subreport if there is only one record in
the detail dataset?
I have a lot of datasets that are connected to other datasets
through one-to-one relationships. I just want to display a single
field of the detail dataset, and it seems unnecessary to use
a subreport for that. I've looked in the manual but all examples
assume that there are more than one record in the detail dataset
for each given record in the master dataset.
Have I missed something? It seems to work to just connect the detail
field to its detail pipeline.
What happens if there actually are more than one corresponding record
in the detail dataset? Is it defined what record will display if the
field is accessed in the master report, or will I get a random one?
Regards,
Örjan Råberg
the detail dataset?
I have a lot of datasets that are connected to other datasets
through one-to-one relationships. I just want to display a single
field of the detail dataset, and it seems unnecessary to use
a subreport for that. I've looked in the manual but all examples
assume that there are more than one record in the detail dataset
for each given record in the master dataset.
Have I missed something? It seems to work to just connect the detail
field to its detail pipeline.
What happens if there actually are more than one corresponding record
in the detail dataset? Is it defined what record will display if the
field is accessed in the master report, or will I get a random one?
Regards,
Örjan Råberg
This discussion has been closed.
Comments
fields will be available from both tables in one datapipeline. You don't
need to use a subreport in this case. You can create a group around the key
linking field if you want to control the printing of the data using a group,
ie. start new page or keep together. If there is more than one "detail"
record in the joined dataset, then you will have two detail bands printed in
your group. Use the group header band to display the "master" data and the
detail band to display the "detail" data.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
The datasets (TBoldDataSet) are wrappers around lists in the object
framework Bold for Delphi and they do not support join. We have created DADE
extensions to make the datasets available in ReportBuilder, and it works well.
I would like to know what happens if I connect e.g. a DBText control in
the master report to a field in a detail pipeline. Will it work, or am I
just having luck that it seems to work?
Regards,
?rjan R?berg
detail data. You can't guarantee that you'll have only one detail record.
If you know that you'll only ever want to print the first detail record for
every master, then you can reference the detail datapipeline on the data
aware control in the master record as you are doing. When the master data
pipeline traverses to the next record, the detail datapipeline moves to its
first record for the master dataset. This is normal lookup behavior. If you
don't use a subreport, then the detail datapipeline will just sit there and
no detail records will get traversed beyond the first detail for the master.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com