Jump to content
Changes to the Jaspersoft community edition download ×

Urgent : multiplicate two field

Recommended Posts

By: brigand silvere - brsilve

Urgent : multiplicate two field

2003-11-04 07:24



I'm working in an industrial projet in which we will, perhaps, use Jasper Report.


To be sure that the client accept Jasper Report as the solution for his project, we need to build quickly a prototype.


In this way, how can I multiplicate two Field (For instance, priceUnit and rate)

<textFieldExpression class="java.lang.String">

$F{priceUnit} .... $F{rate}



Thanks for your answer





By: Alexander Wallace - aows

RE: Urgent : multiplicate two field

2003-11-04 08:10

if the fields are of type double or integer, you can use the property intValue or doubleValue to multiply them, just like you would in a regular java program. If they are strings you need to parse them into whatever type you need (Integer.parseInt(string)). You can enter regular java expressions in the values for fields. Use the $F{fields} as variables. You may need to cast them from time to time.





By: Fred Welland - fwelland

RE: Urgent : multiplicate two field

2003-11-04 08:42

how about something like this:


<textFieldExpression class="java.lang.Double">

new DoubleI( $F{priceUnit}.doubleValue() * $F{rate}.doubleValue() )


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...