Overview
Version
Report Server Version | Plugin Version |
---|---|
11.0 | V1.0 |
Application Scenario
To determine which options need to be selected from drop-down boxes or drop-down checkboxes, you may need to refer to additional fields in the dictionary table. To achieve a similar effect, the original solution is to re-enter data in a pop-up box by JS, which is, however, troublesome and time-consuming especially in numerous scenarios using this solution.
This document introduces a solution using the Query Association Widget plugin, offering a simple workflow and higher time efficiency, as shown in the following figure.
Notes
1. The plugin is not supported on mobile terminals.
2. The plugin does not support new frontend styles.
3. The plugin does not support the Widget Display Enhancement function.
4. The query association widget can be used on the parameter panel and in cells, while you cannot assign values to the widget inserted in a cell.
Plugin Introduction
Plugin Installation
You can obtain the plugin at https://market.fanruan.com/plugin/ef7bd095-87a2-4ec7-ae3d-70b00d92c6ed.
For details about how to install plugins in the designer, see Designer Plugin Management.
For details about how to install plugins on the server, see Server Plugin Management.
Plugin Usage
After the plugin is installed, Query Association Widget is added to the widget toolbar. You can drag the widget into the parameter panel, as shown in the following figure.
Widget Attribute
The attributes of the query association widget are similar to those of the drop-down tree widget.
The following figure shows the new functions of the query association widget.
The following table describes the setting items.
Setting Item | Description |
---|---|
Associated Main Widget Name | Name of the widget that receives the returned value from the query association widget. |
Associated Table Configuration | Option to be bound to the query association widget. This item must be configured, otherwise, the widget will not display any option. Key Value Field: field whose value will be returned to the associated main widget when an option in the query association widget is selected. Referenced Field: field to which you refer for filtering when you need to select an option from the query association widget. |
Support Multi-Selection | Whether to allow you to select multiple options from the query association widget. If Support Multi-Selection is selected, you can select multiple options. |
Count Per Page | Number of rows (10 by default) displayed per page in the pop-up box. |
Pop-up Box Height Pop-up Box Width | Height (500 px by default) and width (750 px by default) of the pop-up box. |
Return String | Whether to return the value as a string to the query association widget. |
Example
Example Scenario Description
Except for all orders of a specific customer, you also want to query several specific orders placed by the same customer within a certain time period.
To achieve this, you can use Query Association Widget to obtain the required order IDs through filtering by fields such as Customer ID and Order Date.
Data Preparation
Create the following two datasets:
Order: SELECT * FROM Orders
Order & Details: SELECT * FROM Orders, OrderDetails_new WHERE Orders.'Order ID'= OrderDetails_new.'Order ID' ${if(len(ID) == 0,"","and Orders.'Order ID' in ('" + ID + "')")}
Report Design
Adding Widgets to the Parameter Panel
Design the parameter panel, as shown in the following figure.
1. Configure the query association widget, as shown in the following figure.
2. For the drop-down checkbox widget, set Widget Name to ID, Returned Value's Type to String, and Separator to ',', as shown in the following figure.
3. Configure other widgets as required, which is not elaborated on here.
Designing the Report Body
Drag the corresponding fields into cells A2 to D2, as shown in the following figure.
Effect Display
Click Data Entry Preview. The following figure shows the effect.
Template Download
For details, you can download the template Query Association Widget.cpt.