Defining hierarchies

Hierarchies can be defined in a business view to allow users to drill report data up and down to particular groups on JReport Server. A hierarchy is defined as a hierarchy category holding one group of data objects sharing a hierarchical relationship, following the order from the highest level to the lowest. For example, these data objects can be added into one hierarchy group called Dates: Sales Year, Sales Quarter, Sales Month, and Sales Date. When any of these group fields are used for grouping data in a table, crosstab or chart, end users can use the context menu to drill up or down to the next level. You can create any number of hierarchy categories such as dates, times, geography, product types, etc.

To define a data hierarchy:

  1. In the Business View Editor, click the Hierarchy Management button on the toolbar or select Hierarchy Management from the Tools menu. The Hierarchy Editor dialog will then appear. See the dialog.
  2. Click <Add Hierarchy...> in the Hierarchy box to add a hierarchy category for grouping one kind of hierarchical data. Right-click the hierarchy category and click Rename on the shortcut menu to rename it if necessary. Then make sure the category is selected.
  3. Select the data objects that share a hierarchical relationship from the Group box and click to add them to the hierarchy category.

    If in the Group box there is an existing category containing just the hierarchical data objects you want to add in a hierarchy group, you can simply select the category name and click to create a new hierarchy containing all the data objects of the category.

  4. Adjust the order of the data objects in the hierarchy by first selecting them and then clicking or or the Move Up and Move Down options on the shortcut menu.

    To remove a data object from the hierarchy, first select it and then click or the Remove option on its shortcut menu.

  5. If you want to add another hierarchy, click <Add Hierarchy...> and repeat the above steps.

    To adjust the order of the added hierarchies, select the hierarchies and then click or or the Move Up or Move Down options on the shortcut menu.

    To delete a hierarchy, select it and then click or click Remove on its shortcut menu. If you want to remove all the hierarchies, click Remove All on the shortcut menu.

  6. When done, click OK to accept the changes.

See also Hierarchy Editor dialog for additional help about the options in the dialog.