Link to home
Start Free TrialLog in
Avatar of DOCDGA
DOCDGA

asked on

I get an error saying "The left-hand side of an assignment must be a variable" while compiling report in Jasper Report

Hi,
I am working on editing a Jasper report. When I assign a double value to a variable which is of type double, I am getting the following error during compilation:

The left-hand side of an assignment must be a variable             (((java.lang.Double)variable_slabSum.getValue())=new Double(0.0) && (((java.lang.Double)field_percent.getValue()) + " of first " + ((java.lang.Double)field_slab_end.getValue()))

"slabSum" is a variable created of type double and I am trying to assign a value of "0" to it, when certain condition is met, in a conditional statement.
$V{slabSum}==0 ?
    ($F{percent} + " of first " + $F{slab_end}) :
            ($V{slabSum}=new Double(0.0) && ($F{percent} + " of first " + $F{slab_end})))

Any suggestions would be helpful.

Thank you
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DOCDGA
DOCDGA

ASKER

Hi James,

 Really appreciate your time in answering the question posted. I am a new bie too to jasper reports.
The first expression is the one interpreted by Jasper Reports software. The second expression in my previous post in the one that I have written. I have already declared the variable to be double.

Thanks
Sorry, but I don't really know what else to suggest.  After some looking around, I suspect that you may need to change how you're trying to reset that variable.  Maybe something like a scriptlet, or maybe change something in the variable definition.

 FWIW, you seem to just be saying that if slabSum is not 0, then set it to 0, which seems a little odd.  It's just alternating between 0 and whatever value you're putting in it somewhere else?  If nothing else, the If seems unnecessary.  Couldn't you just always set it to 0 at that point?  If it's not 0, you make it 0; and if it's already 0, setting it to 0 won't change anything.


 If no one else joins in, you can use the "Request Attention" link to see if the mods can get some others to look at your question.  But since it's the start of the weekend, you might want to give it some more time and wait until Monday or Tuesday.

 James