Example showing how to highlight duplicate data in a table using a highlight rule and an ArrayList.<br />
<br />
I create an ArrayList in the beforeOpen of my data set.
array = new java.util.ArrayList();
<br />
Then I had to store the values of the column I wanted to check for later in the onFetch()
array.add(row["QUANTITYORDERED"]);
<br />
I also had to store this ArrayList as a global persistent variable from afterClose()
reportContext.setPersistentGlobalVariable("array", array);
<br />
Now that all the values are stored I can use the following scripts as expressions from the highlight rule UI.
var array = reportContext.getPersistentGlobalVariable("array");
var first = array.indexOf(row["QUANTITYORDERED"]);
first;
<br />
Not Equal to
var array = reportContext.getPersistentGlobalVariable("array");
var last = array.lastIndexOf(row["QUANTITYORDERED"]);
last;
<br />