### Inserting a banded object

To insert a banded object into a report, perform either of the following:

- Using dialog
  1. Position the mouse pointer at the destination where you want to insert the banded object. A banded object can be inserted in the report areas listed in Component placement.
  2. Do one of the following to open the Create Banded Object wizard:
     - Click Insert > Banded Object on the menu bar.
     - Click the Insert Banded Object button on the Insert toolbar.
  3. In the Data screen of the wizard, define or select the dataset on which the banded object will be created.
     - New
       If checked, the banded object will be built on a new dataset created from the catalog resources.
     - Existing
       If checked, specify the dataset in the current report set from which the banded object will be created.
     - Current
       If checked, the banded object will be built on the dataset which is used by its parent.
  4. In the Display screen, add the required fields from the Resources panel to be displayed in the banded object, then modify the display name of any added field if necessary by double-clicking its Display Name column.

     If you want to have data in the banded object sorted in a desired order, click the Sort Fields by button, then specify the field(s) on which the sorting will be based and the sorting manner as required (for details, see the same topic Sorting the data on table).

  5. In the Group screen, add the fields as the grouping criteria, and then specify the sorting direction of each group level in the Sort column (for details, see the same topic Grouping the data on table).
  6. To add summaries, go to the Summary screen.

     In the sum on panel (the panel on the right), specify the group to which the summary will be applied (if you select Banded Object, the summary will be based on the whole dataset), add a field from the Resources panel as the sum on field, and then select the function for the summary from the Aggregate Function column.

     Notes:

     - The Break Field is a defined field on which the summary will be calculated (if the break field of a summary field is null, the summary will be calculated based on the whole dataset).
     - When the banded object is created, JReport will automatically give the summaries some proper name labels to help you clarify the meaning of the numbers. The auto generated labels are controlled by the Text property in the Report Inspector. You can manually input the text of the label according to your requirements.
     - If you have created several summaries in the banded object and the summaries have the same function, by default they will be aligned horizontally in the report, However, you can choose to align them vertically by checking Align summaries vertically in the Options dialog (File > Options > Component > Align summaries vertically).
  7. In the Filter screen, define some filter condition(s) to filter the data displayed in the banded object.

     To define a filter condition, click the Add Condition button to add a condition line, then from the field drop-down list, select the field on which the filter will be based, set the operator with which to compose the filter expression from the operator drop-down list, and in the value combo box, type the value of how to filter the field or select the value from the drop-down list.

  8. In the Style screen, specify the style of the banded object.

     If you have specified to insert the banded object into another banded object, by default the banded object will inherit its parent's style. If you want to apply another style to the banded object, uncheck the Inherit Style option and then select the required style from the Style box. For more information, see Inheriting the style from a data container.

  9. Click Finish to insert the banded object.

     If you have specified to insert the banded object in the report body, the banded object will be inserted there upon clicking the Finish button; otherwise, click the mouse button in the location to insert the banded object.

- By dragging and dropping
  1. From the Toolbox panel, drag Banded Object to the destination in the report where allows the insertion of a banded object, and a blank banded object will then be created.
  2. In the Resource View panel, select the dataset you want to use in the banded object from the dataset drop-down list. If you want to create a new dataset for the banded object, select <Choose Data from...> from the list and new a dataset in the New Dataset dialog as required.
  3. Drag the required fields in the specified dataset from the Resource View panel into the banded panels.

After a banded object has been created, you can customize its appearance and behavior by setting properties in the Report Inspector, which can be saved as a CSS style for future use (for details, see Creating a CSS style).

Note: When you choose to create a banded object on a hierarchical data source, pay attention to the unique features of HDS. For details, refer to Developing reports from HDS.