I. Overview
How to get the page number of the content currently displayed in the report block of a dashboard?
II. Example
2.1 New dashboard
1) Create a new dataset [ds1], SQL statement:
SELECT * FROM Sales_Volume
2) Drag and drop a report block to the dashboard, the design of report block is shown in the figure below:
2.2 Let the report block to display data in pages
1) Right-click cell A1, add Conditional Formatting, select Paginate After Row, and use the formula condition: ROW()%10=0, as shown in the following figure:
2) Select the report block, click on the report toolbar in the attribute setting panel on the right, check Use toolbar, and click OK, as shown in the following figure:
2.3 Add button
Drag a button into the dashboard, the button name is get page number, and add a Click event, as shown in the following figure:
The JS code in the event is:
var a = $('div[widgetname=REPORT0]').find('.fr-texteditor').val(); //Get the current page number of report block, where report0 is the name of the report block
var b = _g().getWidgetByName("report0").totalPage; //Get the total number of pages of the report block, where report0 is the name of the report block
alert("NOW:" + a);
alert("TOTAL:" + b);
III. Preview
3.1 PC side
3.2 Mobile
Note: Mobile terminal is not supported.