Inserting a banded object
To insert a banded object into a report, perform either of the following:
- Using the report wizard
- 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.
- 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.
- 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 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.
- In the Display screen, add the required fields from the Resources box 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 fields on which the sorting will be based and the sorting manner as required (for details, see the same topic Sorting the data on table).
- 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).
- To add summaries, go to the Summary screen. In the sum on box (the box 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 box as the sum on field, and then select the function for the summary from the Aggregate Function column.
- In the Filter screen, define some filter conditions 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.
- 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.
- Click Finish to insert the banded object.
If you have specified to insert the banded object in the report body or tabular cell, 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.
See also Create Banded Object wizard for detailed information about options in the dialog.
- By dragging and dropping
- 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.
- 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.
- 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).
Notes:
- When you want 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.
- When inserting a banded object using the report wizard,
- If you have added several group by fields in the Group screen, when the banded object is created, these groups will be indented according to the Customize group indent option setting in the Options dialog. You can configure this option in advance to have the groups indented according to your requirements.
- If you have added some summaries in the Summary screen, 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 also manually edit the text of the label later by setting this property.
- By default, the summaries that have the same function will be aligned horizontally in the banded object. If you want to align summaries of the same function vertically, check the option Align summaries vertically in the Options dialog in advance.
- When you insert an object whose height is determined at runtime into the BandedPageFooter panel (for example, a subreport), but do not set the height of the panel high enough to hold this object, the object might get overlapped with the ones that are in the panel which is above the BPF panel at runtime.
- When you insert a banded object into a banded report with the dataset inherited from the report, you cannot insert the banded object into the BandedPageHeader and BandedPageFooter panel.