Home Analytics DevShare
The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

Highlight duplicates in a table

kclarkkclark BIRT GuruEM
edited December 6, 2013 in DevShare
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()
<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&#91;"QUANTITYORDERED"]);
<br />
Not Equal to
var array = reportContext.getPersistentGlobalVariable("array");
var last   = array.lastIndexOf(row&#91;"QUANTITYORDERED"]);
<br />

Kristopher Clark

Actuate Corporation – The BIRT Company™

http://www.actuate.com | http://birtondemand.com


My Blog



Sign In or Register to comment.