SubReport does not limit display to Master record
I am using Delphi 7 and ReportBuilder 10.02 Enterprise and a SQL
database (SQLAnywhere 9.02)
I am having difficulty in getting a Master\Detail report to work using
the above. I am trying to do most of the database setup and links
within the report Data tab and would prefer not to use the Delphi
datasource linking or the DataPipeline.OnRecordPositionChange event.
When I run the report in preview, the subreports do not restrict the
data to the current Master record but will display all of the detail
records. If the master table has 5 rows and each each master record
finds 5 items, then viewing the data view for each of the tables will
show the correct data - 5 master records and 25 item records.
The data is defined as follows
Within the DADE ihave selected:
A Master table for Orders
Order by EntryOrderID
A Detail1 table for Items
Order by EntryOrderID,ItemCode
Link to Orders using EntryOrderID.
A Detail2 table for Charges
Order by EntryOrderID,ChargeCode.
Link to Orders using EntryOrderID.
With DADE, there is a link for table Detail1 linking back to Master
using the EntryOrderID. In the link dialog box, Option 1 of the dialog
is selected (include only matching entries). Similarly there is a link
from Detail2 table back to Master as per the above.
If I restrict the number of records available to the Master table, the
correct data appears to be selected for all of the detail tables but I
cannot figure out how to restrict the subreport to display the
appropriate entries for current master table record.
Any assistance greatly appreciated.
database (SQLAnywhere 9.02)
I am having difficulty in getting a Master\Detail report to work using
the above. I am trying to do most of the database setup and links
within the report Data tab and would prefer not to use the Delphi
datasource linking or the DataPipeline.OnRecordPositionChange event.
When I run the report in preview, the subreports do not restrict the
data to the current Master record but will display all of the detail
records. If the master table has 5 rows and each each master record
finds 5 items, then viewing the data view for each of the tables will
show the correct data - 5 master records and 25 item records.
The data is defined as follows
Within the DADE ihave selected:
A Master table for Orders
Order by EntryOrderID
A Detail1 table for Items
Order by EntryOrderID,ItemCode
Link to Orders using EntryOrderID.
A Detail2 table for Charges
Order by EntryOrderID,ChargeCode.
Link to Orders using EntryOrderID.
With DADE, there is a link for table Detail1 linking back to Master
using the EntryOrderID. In the link dialog box, Option 1 of the dialog
is selected (include only matching entries). Similarly there is a link
from Detail2 table back to Master as per the above.
If I restrict the number of records available to the Master table, the
correct data appears to be selected for all of the detail tables but I
cannot figure out how to restrict the subreport to display the
appropriate entries for current master table record.
Any assistance greatly appreciated.
This discussion has been closed.
Comments
- when defining a link, make sure that you drag the field from the detail to
the master (i.e. do no drag from the master to the detail). When the link
draws, there will be a 1 by the master and an infinity sign by the detail.
- try a simpler test. Use a master and one detail query. Do not use an order
by for either query. Drag the detail field to the master field.
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com