We will introduce Bind Parameter Control to Data in this article.In order to facilitate parameter query data function, FineReport provides a specific parameter interface to place and query related controls in our report designer.

1. Description

To facilitate parameter query data function, FineReport business intelligence tool provides a specific parameter interface to place and query related controls.

2. Example

Based on the figure below, we will create a simple Query Interface to understand how to create a parameter query interface.

2.1 Open report

Open report.This template is the sample template in Template Parameter section, where a parameter interface is added. Now, we will take this template as an example to introduce how to use parameter interface.

2.2 Parameter layout

As shown below, drag the control to corresponding position, as shown below:

In addition: The parameter interface adopts Absolute Layout. Therefore, you can drag the control to any position on the panel.

2.3 Editing style of parameter control

All default parameter controls are text boxes. Sometimes, if you want to select date with Date control or directly select data via a drop-down box, you need to define the editing style of parameter control.

For example, set the area control as a drop-down box. Select Area control and the Wrench in the control. Select Control Type in the dialog below as a drop-down box:

Note: To change a selected control type, you need to delete the original control and drag the required control type from the Control List to the Parameter Interface. Then, change the control name as the parameter name.

In Basic Attributes > Data Dictionary of Attribute table, set the drop-down box data as shown below:

Note: Set Data Dictionary for control means to bind an option value for the control. In general, it is applicable to controls where values can be directly selected, like drop-down box, drop-down tree, etc.

In addition: If the control is bound to the data set parameter, as the default value of data set parameter cannot be directly transferred to the parameter panel control, you need to additionally set the control default value. For details, refer to Control Default Value. However, the default value of Template Parameter can be directly transferred to the control default value, requiring no additional setting.

2.4 Control name

Parameter and control are bound via control name. That means, the control name is consistent with the parameter name. If the parameter control is generated by clicking the Parameters Below Not Generated button at the right bottom, the control name will be automatically bound to the parameter. If the parameter control is dragged, you need to change the control name in the Control Name Attribute to make it consistent with the parameter name.

2.5 Save and preview report

Save report and view the effect via Page Break Preview.