#### Automatic drilling

Automatic drilling enables you to switch from the current group to another group by using system-defined commands on the shortcut menu, and it is divided into four kinds:

- Drill-to
  It enables you to obtain a different view of data by switching among groups.
- Drill-to-by-value
  It enables you to filter data based on a drill-to action so as to obtain a more detailed view of the data.
- Drill-down
  It enables you to drill data to lower groups according to predefined hierarchies. For more information about hierarchies, refer to Defining hierarchies in the JReport Designer User's Guide.
- Drill-up
  It enables you to drill data to higher groups according to predefined hierarchies.

Drilling actions are performed on crosstabs, charts, grouped tables and banded objects, whose data are based on business view or if on query, data fields of which can be converted to corresponding view elements (see the note in Analytic reporting for details). After drilling, the new component can be analyzed in the same way as the original one.

Assume you have created a crosstab report on the business view WorldWideSalesBV in Data Source 1 of the SampleReports catalog showing product sales information with Region as the column field, Sales Year as the row field, and Total Sales as the summary field, and applied the Neutral style to the crosstab. The crosstab shows as follows:

We will now take the crosstab as an instance to illustrate the automatic drilling functions.

##### Drill-to

1. Right-click any value of Region, Asia-Pacificfor example, and choose Drill To from the shortcut menu. The list of groups available for Drill To will appear on the submenu.

2. Click Product Type on the submenu, then in the regenerated result, we can see that Sales Year remains the group for rows and Product Type becomes the group for columns.

3. Repeat Steps 1 and 2 to drill the data to other groups. Row field can also be drilled freely.
4. To go back to the original report, right-click any value of Product Type, choose Drill To > Region from the shortcut menu.

##### Drill-to-by-value

1. Go back to the original report in the above example.
2. Right-click the value Asia-Pacific of the Region group, and point to Drill to by Value on the shortcut menu. A submenu for the command is displayed, which lists the same items as those of Drill To.
3. Click Product Type too and the result will be regenerated.

   We can see that the result is different from that of drill-to. This is because that, for the drill-to-by-value action, the group of columns changes to Product Type by the Region value Asia-Pacific. That is, on the basis of the drill-to action, a filtering action where Region = Asia-Pacific is further performed, and thus the result of drill-to-by-value is generated.

   In addition, when a drill-to-by-value action is performed, the Drill Filter panel will be displayed on the left of the Page Report Studio window, which shows the group and the value the filter is based on.

4. To go back to the original report, first delete the drill filter in the Drill Filter panel by clicking X next to the group name, then right-click any value of Product Type and click Drill To > Region from the shortcut menu.

##### Drill-down

Drill-down actions are based on predefined business view hierarchies. The WorldWideSalesBV contains a hierarchy Geography, which allows you to drill a group (corresponding to a high level) down to the one-level-lower group.

1. Go back to the original report in the above example, right-click the value North America , on the shortcut menu, point to Drill Down, and we can see that Country is listed as the submenu item.

2. Click Country to see the result. It displays the data about countries in the North America region.

3. The one-level-lower group for Country defined in the hierarchy is State. Now click Canada directly and JReport will also drill it down to State.

   After these two drill-down actions, we can see two filters are added in the Drill Filter panel, Region = North America and Country = Canada.

   This is because, when you perform a drill-down action, a filter will be created based on the value you click on. In this example, we first click on the North Americaregion, so JReport drills this region one-level down to display countries in North America, and thus the filter Region = North America is created. If you want all data in the one-level-lower group to be displayed when you drill down a group, you can remove the corresponding filter from the Drill Filter panel.

##### Drill-up

Drill-up actions allow you to drill a group (corresponding to a low level) up to the one-level-higher group.

1. Based on the report result after drill-down, right-click any value of State, BC for example, on the shortcut menu, point to Drill Up, and we can see that Country is listed as the submenu item.

2. Click Country to see the result. The group is drilled one level up. Country is now the group for columns.

3. The one-level-higher group for Country defined in the hierarchy is Region. Now right-click any value of Country, Canada for example, on the shortcut menu, point to Drill Up and click Region, JReport will drill it up to Region.

Notes:

- A JReport Live license for JReport Server is required in order to use this feature. If you do not have the license, contact your Jinfonet Software account manager to obtain it.
- For banded object and table, you can right-click its group header/footer to show the shortcut menu so as to use the automatic drilling functions, you can also right-click field values in the group header/footer to achieve this.
- For group objects that not used as group fields in a banded object or table, automatic drilling doesn't take effect.
- JReport allows you to define display names for items to be shown on the drill-related menu items. For detailed information, see Customizing the field display names in the JReport Designer User's Guide.
- You can also directly click group objects to perform the drill-down action, however, for page reports created in JReport Designer, if there are other actions defined on the group objects at the same time, you can drill down the objects by a single click only when the click priority of the drill-down action is specified to be the highest at report design time. Otherwise, you have to use the Drill Down command on the objects' shortcut menu to perform the action.