Overview
Version
Report Server Version | Functional Change |
11.0 | - |
Problem
When editing summary reports, how can you dynamically sum only the values in the rows where checkboxes are selected?
Implementation Method
By hiding columns, you can judge if the value in the current can be selected when you select the current row. When the current row is not selected, the value in the row will be assigned to 0, and then you can sum the hidden columns.
For details, see Selecting All and Batch Operation by JS in a Checkbox Widget.
Procedure
Data Preparation
Create a sheet and create a built-in dataset named Embedded1, as shown in the following figure.
Template Designing
The following figure shows the report design.
1. Drag the Number and Quantity fields into cells B2 and C2 respectively, and set the left parent cell of B2 to none.
2. Right-click cell A2, select Widget Setting, and select Checkbox Widget, and set the left parent cell of A2 to B2.
3. Enter the formula IF(A2 = TRUE, C2, 0)in cell D2: , and enter the formula SUM(D2) in cell C3.
4. Select column D, right-click the column, and select Hide from the toolbox to hide column D, as shown in the following figure.
Effect Display
Save the template and click Data Entry Preview. The effect is the same as that shown in section "Problem."
You can preview the template on mobile terminals, as shown in the following figure.
Template Download
Click to download the template: Sum of Values in Rows Where Checkboxes Are Selected.cpt.