I. Description
If using Conditional Formatting to hide rows of the expanded data, the sequence numbers which were made before expansion should be changed.
We can use JS to hide rows and renumber the visible rows.
II. Solution
Judge whether a line has been hidden by JavaScript, and then number those that are not hidden.
III. Demo
1) Create a new dataset ds1:
SELECT * FROM Sales_Volume
2) design report as follows. The parent cell of A2 is B2:
3) Select cell B2, and set Conditional Formatting to hide rows whose value in column Region is North China. The settings are as shown below:
4) Select cell F2,select Conditional Formatting to hide rows with sales volume greater than 300. The settings are shown below:
5) Open Template > Web Attributes and select Pagination Preview. Select Individually set for the template,and add a Loading End event:
The JS code:
$(".x-table tr:visible").each(function(i){
if(i>0){
$(this).find("td:first").text(i);
}
})
If the first row is duplicated or frozen, then change the JS code as:
$(".x-table:last tr:visible").each(function(i){
$(this).find("td:first").text(i+1);
})
IV. Preview
Save report, select Pagination Preview, and the results are as shown below:
Tips: Not support mobile devices.