surf3rb0y Posted August 12, 2006 Share Posted August 12, 2006 how do i multiply two fields in ireport. basicly i have fields $F{rate} and $F{hours} and i need to multiply them so i can get a total. Thanks Surf3rb0y Link to comment Share on other sites More sharing options...
jsolis Posted August 16, 2006 Share Posted August 16, 2006 Try something like this: new Double( $F{rate}.doubleValue() * $F{hours}.doubleValue() ) but watch out for nulls. Link to comment Share on other sites More sharing options...
surf3rb0y Posted August 16, 2006 Author Share Posted August 16, 2006 Do i have to use a variable or can i just enter it into the field? Link to comment Share on other sites More sharing options...
jsolis Posted August 16, 2006 Share Posted August 16, 2006 Just enter the expression in the Properties of the Text Field "Textfield Expression" (where you'd normally enter a Field name). Link to comment Share on other sites More sharing options...
rohithshetty Posted January 19, 2007 Share Posted January 19, 2007 jsolis wrote:i want to know how to get the field values from xml file to ireport.i need the reply as soon as possible,plz help mePost edited by: rohithshetty, at: 2007/01/19 06:47 Link to comment Share on other sites More sharing options...
rafa Posted January 19, 2007 Share Posted January 19, 2007 Also you can: 1) Create a new field (in the SQL expression) called "total" for example. To make that you must write: SELECT SUM(tablename1.rate} * tablename2.hours) as "total" 2) Or you can create a new double variable (SUM calculation type) and in the "variable expression" write $F{rate}.doubleValue() * $F{hours}.doubleValue() See you Rafa Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now