We have a report with three fields created. Now we will set the drill-down key. A drill-down key is simply a field which the sub-report looks through to match values when it is passed a value by some other report. The Ad Hoc does not check to see if the value passed is valid or logical, it simply looks through the drill-down key field to see if there are any matches. If there are matches, it returns records associated with that match as if we ran a filter which equals that value. If there are no matches, it returns a page which states "No Results".
We can either set one drilldown key or both of them. A sub-report with one key set will only search through the first drill-down key field for a match. A sub-report with both drill-down key fields set will search through the first (top) field, obtain a set of matches, and then search those matches for values in the second drill-down key field. This means that if the first field returns no matches at all, the second field will have no valid records to search through.
We can also select whether we want to ignore the first key and just use the second key. This means that we will pass the first value to the sub report, but then the sub-report ignores this value and immediately searches through the second drill-down key field as if the first drill-down key field returned ALL results. The main report will still require both keys to be passed, which we will cover below as well. As an example, if you have a field you do not wish to expose to users, such as an ID field, then you can specify that the drilldown link appears on a name field (such as Client Name) and pass the Client Code field to the sub-report without ever exposing it to the user.
For now, we will set the drill-down keys to Client Code and Client Name 1 and we will not ignore Client Code.
Note: Earlier versions of Ad Hoc reports only allow one drilldown key to be used.