Jump to content
Changes to the Jaspersoft community edition download ×

how can i compare two field values in ireport


manoj_pan123

Recommended Posts

Errors were encountered when compiling report expressions class file:

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:277: operator <= cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] value = (java.lang.String)(((((java.lang.String)field_refundTransactionTenderType.getValue()).equals("HOME_OFFICE_CHECK")|| ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("CHECK") || ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("CURRENCY")|| ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("TRAVELERS_CHECK")) && (((java.math.BigDecimal)field_refundTransactionAmount.getValue()) <= ((java.math.BigDecimal)field_refundTransactionItemAmount.getValue())))

[jrc] ^

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:285: operator > cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] : (((java.lang.String)field_refundTransactionTenderType.getValue()).equals("COUPON")|| (((java.math.BigDecimal)field_refundTransactionAmount.getValue()) > ((java.math.BigDecimal)field_refundTransactionItemAmount.getValue())))

[jrc] ^

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:655: operator <= cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] value = (java.lang.String)(((((java.lang.String)field_refundTransactionTenderType.getOldValue()).equals("HOME_OFFICE_CHECK")|| ((java.lang.String)field_refundTransactionTenderType.getOldValue()).equals("CHECK") || ((java.lang.String)field_refundTransactionTenderType.getOldValue()).equals("CURRENCY")|| ((java.lang.String)field_refundTransactionTenderType.getOldValue()).equals("TRAVELERS_CHECK")) && (((java.math.BigDecimal)field_refundTransactionAmount.getOldValue()) <= ((java.math.BigDecimal)field_refundTransactionItemAmount.getOldValue())))

[jrc] ^

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:663: operator > cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] : (((java.lang.String)field_refundTransactionTenderType.getOldValue()).equals("COUPON")|| (((java.math.BigDecimal)field_refundTransactionAmount.getOldValue()) > ((java.math.BigDecimal)field_refundTransactionItemAmount.getOldValue())))

[jrc] ^

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:1033: operator <= cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] value = (java.lang.String)(((((java.lang.String)field_refundTransactionTenderType.getValue()).equals("HOME_OFFICE_CHECK")|| ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("CHECK") || ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("CURRENCY")|| ((java.lang.String)field_refundTransactionTenderType.getValue()).equals("TRAVELERS_CHECK")) && (((java.math.BigDecimal)field_refundTransactionAmount.getValue()) <= ((java.math.BigDecimal)field_refundTransactionItemAmount.getValue())))

[jrc] ^

[jrc] C:SVN_Currentcsk_posreport.tempDailyRefundTransactionReport_1184315449517_40192.java:1041: operator > cannot be applied to java.math.BigDecimal,java.math.BigDecimal

[jrc] : (((java.lang.String)field_refundTransactionTenderType.getValue()).equals("COUPON")|| (((java.math.BigDecimal)field_refundTransactionAmount.getValue()) > ((java.math.BigDecimal)field_refundTransactionItemAmount.getValue())))

[jrc] ^

[jrc] 6 errors

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

You should cast $F{refundTrasactionAmount} AND $F{refund_TransactionItemAmount} to an 'int' Or a 'double' before applying the .equals() method to them...

 

Try this:

Code:

... && $F{refund_TransactionItemAmount}.intValue()

&& Integer.parseInt($F{refund_TransactionItemAmount})

 

Or something like it. Research the conversion methods used in java, that is what your problem is.

Link to comment
Share on other sites

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