Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » conditional printing and output manipulation
conditional printing and output manipulation [message #243716] Wed, 20 June 2007 21:24 Go to next message
Eclipse UserFriend
Originally posted by: pashakaz.gmail.com

Hello,
I'm trying to develop reports that emulate Jasper reports with as great
an accuracy as possible. JasperReports have a functionality for
"printWhen" expressions which will conditionally print or not print a
field depending on some condition. After exploring the BIRT designer and
the appropriate APIs for some time, the closest thing i found to this
functionality was the java interface IScriptedDataSetEventHandler that
lets you conditionally exclude rows of data. similar functionality does
not seem to be present in other dataset event handlers or static types.
As an example of what I'm trying to accomplish, I would like to be able to
read off of a jdbc data source. Then if the value fetched from the data
source begins with an x I want that value to not be printed. Or i would
like to append some message to any value thats less than 10 characters. I
would like to know whether this functionality exists, and if it does how
to achieve it.
Re: conditional printing and output manipulation [message #243739 is a reply to message #243716] Wed, 20 June 2007 23:07 Go to previous messageGo to next message
Der Spunk is currently offline Der SpunkFriend
Messages: 58
Registered: July 2009
Member
Try to select the report element you want to hide and in the "Properties"
view select the "Visibility" tab. You can provide a boolean expression to
control
when to hide the report element.

In order to manipulate what should be displayed have a look at the "Map"
tab - here you can control what to show to the user depending on the value
that is coming from the data set. As an alternative you could also use a
computed column.

Spunk


"Pavel Kazatsker" <pashakaz@gmail.com> schrieb im Newsbeitrag
news:a6f777422eeb384ee3c6c3de54b29be5$1@www.eclipse.org...
> Hello,
> I'm trying to develop reports that emulate Jasper reports with as great
> an accuracy as possible. JasperReports have a functionality for
> "printWhen" expressions which will conditionally print or not print a
> field depending on some condition. After exploring the BIRT designer and
> the appropriate APIs for some time, the closest thing i found to this
> functionality was the java interface IScriptedDataSetEventHandler that
> lets you conditionally exclude rows of data. similar functionality does
> not seem to be present in other dataset event handlers or static types.
> As an example of what I'm trying to accomplish, I would like to be able to
> read off of a jdbc data source. Then if the value fetched from the data
> source begins with an x I want that value to not be printed. Or i would
> like to append some message to any value thats less than 10 characters. I
> would like to know whether this functionality exists, and if it does how
> to achieve it.
>
Re: conditional printing and output manipulation [message #243893 is a reply to message #243739] Thu, 21 June 2007 13:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pkazats.us.ibm.com

the JasperReports version of this accomplishes that with calls to java
methods, is there anything in birt that will allow me to accomplish my
code using java code as well?
Re: conditional printing and output manipulation [message #244078 is a reply to message #243893] Thu, 21 June 2007 19:01 Go to previous messageGo to next message
Der Spunk is currently offline Der SpunkFriend
Messages: 58
Registered: July 2009
Member
You can call Java from Javascript expressions, eg. in the visibility
expression you write something like:

importPackage(Packages.java.util);
result = new Random().nextBoolean();

Spunk

"Pavel Kazatsker" <pkazats@us.ibm.com> schrieb im Newsbeitrag
news:9ce3326a3819989acbacf99f2822e463$1@www.eclipse.org...
> the JasperReports version of this accomplishes that with calls to java
> methods, is there anything in birt that will allow me to accomplish my
> code using java code as well?
>
Re: conditional printing and output manipulation [message #244112 is a reply to message #243893] Thu, 21 June 2007 20:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: a.x.com

You can call the setOnRender method of the DataItemHandle class which
contains the value of individual datalements in teh report,you can set the
expression with javascript code that checks the length of teh data content
and does appropriate formatting.

Thanks.
Re: conditional printing and output manipulation [message #244586 is a reply to message #244112] Mon, 25 June 2007 14:04 Go to previous message
Eclipse UserFriend
Originally posted by: pashakaz.gmail.com

Is there any way to set entire blocks (such as a list header) not to print
without setting each individual element?
Previous Topic:DataSource Connection Parameters in a library
Next Topic:ROM Scripts: columnDefns no more allowed in 2.2 ?
Goto Forum:
  


Current Time: Sat Dec 21 14:32:08 GMT 2024

Powered by FUDForum. Page generated in 0.03900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top