Jump to content
We've recently updated our Privacy Statement, available here ×

ice_raven

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Posts posted by ice_raven

  1. giulio wrote:

    Hi Neil,
    20.10 + 20.87 you get 40.97 (and you'll trnsform it in 41.37)

    but what if you have:

    20.50 + 20.59? you get 41.09 (and this can not be corrected because 09 is < than 60, but the correct number should be: 41.49, not 41.09)

     

    I have tested my code in a Java program and it works. If the amount is smaller than 60, then it does nothing.

    (I am using a shorthand if).

     

    I would just like to know how I can use operators (Like + - < > ...) in a variable expression in iReports.

     

    Kind Regards

    Neil

  2. I have a field which shows minutes as a double. (eg 20.07 minutes)

    Then I have a variable which sums all these numbers to get a total that displays for each group.

    Simply adding these numbers don't work as you can get 20.95 minutes.

    All the expression does is get the number after the '.' and if it's above 60, minus 60 from it and ad 1 to the minutes.

    But it doesn't want to compile because I'm using '>' and '-'.

  3. Hi

     

    Whan trying to use operators in a variable expression (like < > - + ) I get error messages when trying to compile the report.

     

    The error message:

    The operator > is undefined for the argument type(s) Integer, int

     

    My expression:

    ((new Integer(new String($V{totalTime}.toString().substring($V{totalTime}.toString().indexOf("."), $V{totalTime}.toString().length()))) > 60) ? (new Double((new Integer(new String($V{totalTime}.toString().substring($V{totalTime}.toString().indexOf("."), $V{totalTime}.toString().length()))) - 60) & (new Integer(new String($V{totalTime}.toString().substring(0, $V{totalTime}.toString().indexOf(".")) + 1))))) : $V{totalTime})

     

    Could anyone please help me with this?

     

    Kind Regards

    Neil

×
×
  • Create New...