Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Problem with Dataset Filters (Java)
Happy
Hi there,<br />
I was modifying a Java Dataset Event Handler to add this filter:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
DataSetHandle dsh = reportContext.getDesignHandle().findDataSet("DATASETNAME");
FilterCondition fc = StructureFactory.createFilterCond();
String Expression = "(java.lang.String) (row["" + cName + ""])";
fc.setExpr(Expression);
fc.setOperator("match");
fc.setValue1(""" + cVal + """);
dsh.addFilter(fc);
</pre>
<br />
This code is all but ignored when I place it into the BeforeOpen method, no filtering occurs at all (this being the same method where I set the SQL query).<br />
<br />
However, as soon as I move the code into the Initialization method of my Report Event Handler, it works perfectly, filters and everything.<br />
<br />
I'm struggling to understand why this is the case, logically the filters get fired off after the SQL has been executed, so why do they need to be defined prior to the dataset BeforeOpen method<br />
<br />
Any ideas?
Find more posts tagged with
Comments
There are no comments yet