Jump to content
Changes to the Jaspersoft community edition download ×

I-Report Java Help Needed

2005 IR Help

Recommended Posts

By: Porsche996GT2 - porsche996gt2

I-Report Java Help Needed

2005-10-18 11:34

Hello All,


I'm new to Java as well as to this forum. I'm trying to do a calculation on one of the variables and parameters I created in I-Report using Java expressions. The data type I specified for these are double, of which I'm using the float values for calculation since they're decimals with 4 numbers. The calculation is rather convoluted since there are several conditions that have to be specified to executre it. Here's the structure of my if then else statement:








Below is the Java statement I wrote:


main if: ($P{PRIOR_PMPM}.floatValue()<$V{BLENDED_FACTOR}.floatValue())

1st if: ($V{BLENDED_FACTOR}.floatValue-$P{PRIOR_PMPM}.floatValue()<=0.05)

1st then: ?$V{BLENDED_FACTOR}

2nd if based on main if: :($V{BLENDED_FACTOR}.floatValue-$P{PRIOR_PMPM}.floatValue()>0.05))

1st if based on 2nd if: ($V{BLENDED_FACTOR}.floatValue()-$P{PRIOR_PMPM}.floatValue()-0.05)/2<=0.05)

1st then based on 2nd if: ?new Double($P{PRIOR_PMPM}.floatValue()+0.05+(($V{BLENDED_FACTOR}.floatValue()-$P{PRIOR_PMPM}.floatValue()-0.05)/2)

2nd if based on 2nd if:


2nd then based on 2nd if: ?new Double($P{PRIOR_PMPM}.floatValue()+0.1)



Basically here's what the statement above should do:


If PRIOR is less than BLENDED




If ((BLENDED-PRIOR-0.05)/2) <= 0.05

then new Double(PRIOR+0.05((BLENDED-PRIOR-0.05)/2)

If ((BLENDED-PRIOR-0.05)/2) > 0.05

then new Double(PRIOR+0.1)


Any help can will be appreciated. Let me know if this is not clear enough. Thanks!





By: Lukus - lukus2

RE: I-Report Java Help Needed

2005-10-18 14:41



A good way of doing this this is to build an external Java object that takes the parameters and returns the result. This works very well and there is no limit to the complex tasks that can be achieved...




Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...