The information in Master/Detail reports is normally retrieved from multiple tables that have a one-to-many, or master/details relationship. In many cases, you can obtain this type of hierarchical information with a single query. In such a query, you join the data from the master table with the data from the detail table, and insert group breaks to group the detail records for each master record.
A single query designed to show hierarchical information has one major disadvantage. If a master record has no associated detail records, it is not displayed. If you need to show all master records, whether or not they have detail records, a single query will not meet your needs.
The solution is to create a Master/Detail report and bind the detail records to the master records by joining one or more query fields.
To understand the usefulness of a Master/Detail report, you should understand how SQR Production Reporting Studio processes queries. SQR Production Reporting Studio retrieves the first matching record for the master query. It then retrieves all the records for the detail query which correspond to the record matched in the master query.
For example, suppose the master query specifies a column containing the name of a store. The detail query could specify columns containing items sold, quantities, and prices for that store. The report would list the name of the first store and the sales information for that store, then the name of the next store and the sales information for that store. In this example, you could bind the queries by the store ID, which need not appear in the actual report.
The first query you define (the master query) is always the primary query. The other queries are all detail. Think of this master/detail relationship as a hierarchical parent/child relationship. You can define a query to be a child of the master query or a child of a detail query.