Jump to content
Changes to the Jaspersoft community edition download ×

kolaitis

Members
  • Posts

    35
  • Joined

  • Last visited

Community Answers

  1. kolaitis's post in Previous value (value of the field in the previous record) was marked as the answer   
    Suggestion :
    1) Create Variables
    ClassType Expression
    INITIAL BigDecimal $V{SECONDS} InitValue : new BigDecimal(0)
    MINUTES -"- new BigDecimal(minutesOfYourFieldName(2pos))
    SECONDS -"- new BigDecimal(secondsOfYourFieldName(2pos))
    DIFFERENCE_SECONDS -"- ($V{SECONDS}.subtract( $V{INITIAL} )).abs()
    DIFFERENCE_MINUTES -"- $V{MINUTES}.doubleValue()>0 ?
    $V{SECONDS}.add(
    new BigDecimal(60).subtract($V{INITIAL})):null
     
    2) Create two text fields in Detail Band on top of each other :
    a) Expression
    $V{DIFFERENCE_SECONDS}!=null &&
    $V{DIFFERENCE_SECONDS}.doubleValue()>5 ?
    " " :
    " "
    PrintWhenExpression
    new Boolean($V{MINUTES}.doubleValue()==0)
     
    b) $V{DIFFERENCE_MINUTES}!=null &&
    $V{DIFFERENCE_MINUTES}.doubleValue()>5 ?
    " " :
    " "
    PrintWhenExpression
    new Boolean($V{MINUTES}.doubleValue()!=0)
     
    Good Luck.
×
×
  • Create New...