After Releasing the report, sometimes you need to get the cell value by the mouse click event of the cell, how to implement the requirement? RAQ Report implements this function by Defining this function in jsp.
Firstly, we need to know how the report is displayed on the web page. showReport.jsp under the installation directory of RAQ Report: \webapps\quiee\reportJsp is a typical jsp example of report display:
From the figure above, it can be seen that the whole report tag < report:html> is included in a < table> tag, when report is expanded, it is actually expanded in this table.
If you want to get the cell value by mouse click event, you have to locate the cell, And how to locate a cell? Use the name attribute in < report:html> tag, then add the cell name to locate the cell: for example: report1_A1 represents cell A1 in report1.
var cell = document.getElementById(â€?report1_A1â€ł); // locate the cell by ID
alert(cell.value); // pop up a message box to display the cell value by alert() function
< input type=â€?buttonâ€? onclick=_getDispValueByName() value=â€?checkâ€?>
The effect is as follows: