BackPrevious Page Next PageNext

Using Advanced Web Controls

Expanding/collapsing the group records in banded objects

Using parameter controls to specify parameters to reports

Using parameter form controls to run reports

Using filter controls to filter report data

Using navigation controls to undo/redo value selection in filter controls

Advanced web controls refer to Expand/Collapse Group, Parameter Control, Parameter Form Control, Filter Control, and Navigation Control. They are defined with specific web actions and are used for specific purposes.

The advanced web controls can be inserted into the report areas listed in Component placement.

Expanding/collapsing the group records in banded objects

The Expand/Collapse Group web control can be used in the group header panels of banded objects in page reports, so that end users in Page Report Studio can use the web control to expand/collapse records in the groups of the banded objects. Note that, this feature works only in continuous page mode.

To insert to a Expand/Collapse Group web control in a banded object:

  1. Make sure to uncheck the Page Layout command on the View menu.
  2. Select the group header panel, then click Insert > Web Control > Expand/Collapse Group.
  3. Click on the group header panel, and the web control will be inserted there.

After publishing the report to JReport Server and run it in Page Report Studio, end users will be able to use the web control which appears like a plus or minus sign to expand or collapse a group (that is, to show or hide the details of that group). Furthermore, you can use two properties of a group panel to set the expanding/collapsing state of all groups in the corresponding group level. That is, the Expand Detail Data property controls whether or not to expand the groups, and the Shrink Footer property controls whether or not to hide the group footer panel when collapsing the group.

Using parameter controls to specify parameters to reports

A parameter control is a web control that is bound with a parameter used by the current report. By specifying values to the parameter in a parameter control at runtime, end users can pass the parameter values to JReport and run the report with the specified values.

Parameter controls do not support inserting cascading parameters. If you want to do this, use parameter form controls instead.

To insert a parameter control into a report:

  1. Do one of the following:

    The Insert Parameter Control dialog appears.

    Insert Parameter Control dialog

  2. In the dialog, specify the parameter you want to add to the parameter control from the Select a Parameter box, which lists all the parameters except cascading parameters used in the current report. For a report created using business views, you can also use a local parameter.
  3. Click OK to insert the parameter control.

Using parameter form controls to run reports

A parameter form control is a web control that is bound with the parameters used by the current report or other reports. By specifying values to the parameters in a parameter form control at runtime, end users can run the reports with the specified parameter values.

To insert a parameter form control into a report:

  1. Do one of the following:

    The Insert Parameter Form Control dialog appears.

    Insert Parameter Control dialog

  2. Specify the target reports to run using the parameter form control.
  3. Specify whether to include the Submit button in the parameter form control. If Submit is included, it is used to submit the parameter values end users specify in the parameter form control. If Submit is not included, once end users change the value of a parameter in the parameter form control, the new value will be applied automatically.
  4. Click OK to insert the parameter form control.

Note: If you save a report containing a parameter form to another directory or publish it to local directory or to JReport Server, the reports that you selected in the parameter form in order to run will not be saved or published along with the report. You need to ensure that all the reports are published to the same folder on JReport Server.

Using filter controls to filter report data

Filter controls are used to filter one or more data components in a report based on the fields in the data resources the data components are created from. After inserting filter controls, you can also insert a navigation control for undoing/redoing the value selection in the filter controls. The filter created via filter control is also referred to as on-screen filter.

Filter control types

JReport Designer supports three types of filter controls: Text List, Single Value Slider, and Range Slider. However the slider filter control types are supported in library components only.

Filtering scenarios and filter logic

Filtering based on one field is a common usage. Bind a field to a filter control, and then based on the field to filter the data components created from the same data resource as the field. Another special usage is to filter data components created using different data resources. In this case you need to choose a common field all the data resources contain and select the common field from all the data resources to bind them to the filter control. The name of the fields do not need to be the same but the data returned needs to be similar.

After you select values in one or more filter controls in a report, a filter condition based on the selected values of the specified fields will be applied to the designated data components in the report, with each field affecting only the data components based on the same data resource as the field. The value selection logic is as follows:

To insert a filter control in a report:

  1. Do any of the following:

    The Insert Filter Control dialog appears.

    Insert Filter Control dialog

  2. The Control Type drop-down list lists the filter control types that can be used in the current report. If you are inserting a filter control in a page report or web report, only the Text List type is supported.
  3. From the Select Fields drop-down list, select the fields of the same data type to bind to the filter control, then click outside of the drop-down list to close it.

    Select Fileds for Filter Control

    For a text list filter control, after the filter control is created the name of the first displayed field you select in the field list will be used as the name of the filter control.

  4. By default all values of the selected fields are used in the filter control. If you want to customize the value list, check Customize Initial Values and customize the values as you want.
  5. By default, all filter controls that are applied to the same data components are linked. Selecting a value in one filter control, for example, USA, will result in that all the other linked filter controls respond to gray the values that do not belong to or contain USA or that are not related to USA like London. If you do not want the filter control to be affected by other filter controls, unselect Link to Other Filters. For the case of one filter control using a business view and another using a query, if the business view contains the query definition, the two filter controls are also linked.
  6. If you are creating a slider and the fields selected to bind to the slider are of the Date/Time type, the Special Function drop-down list is available. Apply a special function to the fields if needed.
  7. From the Apply To drop-down list, specify which data components the filter will be applied to.

    By default, JReport applies the filter to all the data components created using the data resources in which the selected fields are obtained. If you uncheck the data components which are based on the same data resource as any selected fields, these fields will not be used in the filter and thus their values will not be listed in the filter control.

  8. Click OK to insert the filter control.

    At runtime, end users can select one or more values from the text list filter control, a value from the single value slider, or a value range on the range slider to filter the specified data components. If the fields bound to the filter control have the same values, the values are distinctive in the filter control.

For the filter controls inserted into a report, you can further edit them if you want. To edit a filter control, right-click the filter control and select Edit Filter Control from the shortcut menu. In the Edit Filter Control dialog, edit the filter control settings.

Note: If all the data components in a report created on the same data resource are deleted, the fields in the data resource that have been added in the filter controls in the report will be removed from the filter controls too.

Using navigation controls to undo/redo value selection in filter controls

A navigation control can be considered as an accessorial control for filter controls and is used to deal with the value selection operations in all the filter controls in the same report.

To insert a navigation control into a report, do either of the following:

A navigation control is a combination of three buttons:

By default, these three buttons are displayed as normal buttons, however, you can change their button type to be image button if necessary. To do this:

  1. Select the target button, right-click it and select Button Type > Image Button from the shortcut menu.
  2. In the Image Button dialog, click Browse to specify the path or input the URL of the image source directly in the text box.

    Image Button dialog

  3. Click OK to confirm.

If you want to get back the normal button type, you just need to right-click the target image button, and select Normal Button from the Button Type submenu.

BackPrevious Page Next PageNext