Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use a jar helper to do conditional formatting in Birt Design
Rug Bot
hello!
I'm using Birt (2.5.2) to generating pdf's,
using an Xml Data Source.
For now I have only one design but new one's are coming.
In this design I have some dynamic elements,
I change the visibility of a component
in function to the values in the Xml Data Source.
For example I don't show the paragraph "Account" if:
row["account_balance"] == 0
this expression is used in the property "Visibility" of the component.
And works great.
Now to do better I want to use an Helper (jar) to do the same.
Why?
Because if in the future the formatting condition's changes I don't have to do it in each design
but only change the condition in the helper.
For example I don't show the paragraph "Account" if:
new ReportDataHelper(xmlData).isAccountEmpty()
that return true if the account is equal to 0.
I have searched and I found only that I need a Scripted Data Source and
I have to integrate the jar in the designer.
Anyone know if is the right way? Examples?
I tried with Scripted Data Source to use classes in the Helper but without success.
Thanks a lot.
Roger
Find more posts tagged with
Comments
johnw
I would think that it would be easier to use a Java based event handler. Not sure if the ReportItemHandle supports that. But what you could think about doing is using that and override the OnPrepare event, and apply either a Visibility or Highlight dynamically based on what you put in a properties file. So your properties file would contain a elementName property, with the expression to apply.<br />
<br />
John<br />
<br />
<blockquote class='ipsBlockquote' data-author="'Rug Bot'" data-cid="68583" data-time="1284997934" data-date="20 September 2010 - 08:52 AM"><p>
hello!<br />
<br />
I'm using Birt (2.5.2) to generating pdf's,<br />
using an Xml Data Source.<br />
For now I have only one design but new one's are coming.<br />
<br />
In this design I have some dynamic elements,<br />
I change the visibility of a component<br />
in function to the values in the Xml Data Source.<br />
<br />
For example I don't show the paragraph "Account" if:<br />
row["account_balance"] == 0<br />
this expression is used in the property "Visibility" of the component.<br />
And works great.<br />
<br />
Now to do better I want to use an Helper (jar) to do the same.<br />
Why? <br />
Because if in the future the formatting condition's changes I don't have to do it in each design<br />
but only change the condition in the helper.<br />
<br />
For example I don't show the paragraph "Account" if:<br />
new ReportDataHelper(xmlData).isAccountEmpty()<br />
that return true if the account is equal to 0.<br />
<br />
I have searched and I found only that I need a Scripted Data Source and<br />
I have to integrate the jar in the designer.<br />
<br />
Anyone know if is the right way? Examples?<br />
<br />
I tried with Scripted Data Source to use classes in the Helper but without success.<br />
<br />
Thanks a lot.<br />
<br />
Roger<br /></p></blockquote>