I. Description
Add a JavaScript-type hyperlink to a cell in the report block of the dashboard, the cell can display a cell value whose coordinates correspond to that specified by JavaScript.
II. Example
2.1 Data preparation
Create a new dataset ds1, and the SQL statement is:
SELECT * FROM SALES_BASIC
2.2 Design report block
Drag a report block to the dashboard body and the design of the report block is shown in the figure below:
The data column in cell B2 is set to be shown in the form of Summary, as shown in the figure below:
Enter the formula in cell C2: ROUND(B2 / B3 * 100, 2) + "%", which calculates the sales proportion of each salesperson.
2.3 Add a hyperlink
Select cell B2 and add a JavaScript-type hyperlink. Add a parameter named row and the parameter value is formula: row()
The JS code is as follows:
var ele = "td[id^=C" + row + "]"; //Get the coordinates of the cell, the row number is obtained through the parameter row, C is the column number
var obj = _g().options.form.getWidgetByName("report0").
element.click().find(ele).text(); //Get the value of the cell
FR.Msg.alert('Proportion',obj);
Note: report0 is the name of the report block object in the dashboard, and the object is obtained through the find method in the click event of JavaScript.
2.4 Hidden cells
Select column C and right click to Hide:
Show only the first two columns of data
III. Effect
Note: Mobile terminal is not supported.