Home
Analytics
Conditional Section Equivalent in BIRT
Ivar
HI All, How can i easily emulate Actuates Conditional Section in BIRT ?
I have 2 different formats for my report based on the value i retrieve for ITEMNUM in data row.
If ITEMNUM is NULL particular format, if not another format.
What I have been trying is have 2 tables one below the other in my layout.
Then on each table enabled the 'Hide Element' check box under visibility.
In Expression builder under visibility I am checking for row["ITEMNUM"] == null and then setting true or false.
This approach does not look like its working as it does not switch the report format.
Any help on this is appreciated. Thanks in Advance.
BTW i am using BIRT 2.1.2 on SQL Server 2005.
Ravi.
Find more posts tagged with
Comments
prakash_p
I did similar conditional formatting for one my data items my code as below, this might help you.<br />
<br />
<strong class='bbc'>if(BirtComp.greaterThan(row["XXXXXX"],0))<br />
{<br />
this.getStyle().fontWeight="bold";<br />
}</strong>
prakash_p
by the way, the script is attached to the <strong class='bbc'>onRender</strong> event of the data item that has conditional formatting.
Virgil Dodson
You can also use the Highlights feature to accomplish the conditional styling you want without writing script. The Highlights feature is found in the property editor when you select a table, row, column, cell, data element, labels, and grids.
Ivar
can i completely hide a table using Highlights?
thats what i wanted to do by scripting, if ITEMNUM is null show first table only and hide second table. If ITEMNUM is not null then show only second table and hide first table.
Is this possible using highlights?
Ravi.
Virgil Dodson
You wouldnt want to use highlights for that unless you just wanted to turn all the text white to make it disappear.
You can use visibility property or scripting to hide or drop a table that you don't want visible on the report. Sometimes it is better to drop the table so the associated query is not performed if it is not needed. The enclosed example shows hiding vs dropping a table.