Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
How does the filter in Birt work
Migrateduser
<p>Hi, </p>
<p> </p>
<p>I am hoping someone could please explain to me <u>how </u>the filter in BIRT works. Note, I know <strong>what </strong>filtering does - I need to know <strong>how</strong> to it works. </p>
<p> </p>
<p>I am trying to apply the filter to a table and this filter is to be based on a variable which is a function of the table's row content (but has no contextual relation to table row content). Example, if row["myrow"] = "phone", then the variable value is "elephant". </p>
<p> </p>
<p>I did some tinkering, and was able to trace that the Filter fires before table's rows ever get created, but after .beforeFactory(), as shown below: </p>
<p> </p>
<div>
<pre class="_prettyXprint">
.initialize() fired...
.onPrepare() fired...
.TABLE.onPrepare() fired...
.TABLE-ROW.onPrepare() fired...
.beforeFactory() fired...
Filter invoked on: "phone"
Filter invoked on: "pc"
Filter invoked on: "usb"
.TABLE.onCreate() fired...
.TABLE-ROW.onCreate() fired...
.TABLE-ROW.onCreate() fired...
.TABLE-ROW.onCreate() fired...</pre>
</div>
<p>My questions are:</p>
<p>1) how do the Filters have a knowledge of the row's value 'a priori' to row's creation? if the row's content is only available at .onCreate() event, does the filter then scan the underlying dataset?</p>
<p> </p>
<p>2) is it possible to configure the filter based on a variable that changes as a function of row's content. The simplest example would be: let's say I want to count the number of rows and apply the filter on that count. Obviously, the number of rows will not be known up until .onCreate() gets fired and the counter counts those. But by the time the counter obtains a value different from its initialized state in the .OnCreate() event, it already would be too late since the Filter get's an assignment after .beforeFactory() and before .OnCreate(). </p>
<p> </p>
<p>Interestingly enough, when I <strong>do</strong> use RUNNINGCOUNT to count the number of rows, the Filter <strong>does </strong>see the exact structure of the table correctly before the rows ever get created (how does it do that??) </p>
<div>
<pre class="_prettyXprint">
.beforeFactory() fired...
Filter invoked on: 1
Filter invoked on: 2
Filter invoked on: 3
Filter invoked on: 4
Filter invoked on: 5
Filter invoked on: 1
Filter invoked on: 2
.TABLE.onCreate() fired...
New Group...
.TABLE-ROW.onCreate() fired...
.TABLE-ROW.onCreate() fired...
New Group...
.TABLE-ROW.onCreate() fired...
.TABLE-ROW.onCreate() fired...</pre>
<p>Thanks!! </p>
<p> </p>
</div>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet