#### Preparations

Before you can use the Designer API to perform certain tasks, you need to first make the following preparations.

##### Setting the license key

The license information is set via a method called setUserInfo(String uid, String key), where UID is the user ID, and key is the license key. This method should be called before you can call any other Designer API methods.

##### Getting handle information

All the objects in a report are organized into and browsed from a tree structure. For each report, the Report Inspector consists of a report objects tree at the top of the view panel and its corresponding reporting features or properties at the bottom. Selecting any object node on the tree also selects the same element in the report design area. The two diagrams below cover all objects that can be used in a report with their relationships.

Note: The down arrow indicates a Father-Children inheritance for objects.

Every node and object in the report tree is identified by a HANDLE in JReport Designer API. Therefore, before you can create or edit a report with the Designer API, you will first have to get the handle information. Super class API provides the following methods to get handles of different nodes and different types.

- getHandles()
  Gets all the handles of a report and returns a handle array.
- getHandles(String handle)
  Gets handles of the sub node in the current node and returns a handle array. If it fails, it will return null.
- getHandles(String handle, int type)
  Gets sub node handles of the same types for the given node and returns a handle array. If it fails, it will return null.
- getParent(String handle)
  Gets the parent handle of an object and returns the parent handle. If it fails, it will return null.

Parameters

- handle - Parent node handle when getting sub node handles. Object handle when getting parent handle.
- type - Class type value defined in the API class.
- depth - This is related to the current level in the report tree. When the depth is -1, all handles in the report will be got. When the depth is 0, the handles of the current level will be got. When the depth is number n, the handles of n levels and the current level will be got.