Page 1 of 1
How to change expression use in jaspersoft?
Posted: Fri Aug 05, 2022 1:04 am
by s0930204
I want to change my jasper report to stimulsoft report
How to change this expression ?
Code: Select all
(new Float($F{A}.floatValue()*$F{B}.floatValue())).toString().equals("Infinity")?new Float(0):
(new Float($F{A}.floatValue()*$F{B}.floatValue())).toString().equals("NaN")?new Float(0):
(new Float($F{A}.floatValue()*$F{B}.floatValue()))
I try many times but it doesn't work in stimulsoft
Re: How to change expression use in jaspersoft?
Posted: Fri Aug 05, 2022 10:00 am
by Lech Kulikowski
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more detail?
What does that expression mean in the jasper report?
Thank you.
Re: How to change expression use in jaspersoft?
Posted: Tue Aug 09, 2022 1:01 am
by s0930204
I want to write the same expression as jasper report in stimulsoft text expression
Re: How to change expression use in jaspersoft?
Posted: Wed Aug 10, 2022 9:30 am
by Lech Kulikowski
Hello,
We do not know jasper's expressions.
Could you explain your issue in more detail? What does that expression mean in the jasper report?
Thank you.
Re: How to change expression use in jaspersoft?
Posted: Thu Aug 11, 2022 1:40 am
by s0930204
The expression of jasper report is like the text expression of stimulsoft report.
And it's using java language.
Re: How to change expression use in jaspersoft?
Posted: Thu Aug 11, 2022 7:36 am
by Lech Kulikowski
Hello,
You can use calculations in the expression as you need:
{datasourceName.columnName1 * datasourceName.columnName2 + datasourceName.columnName3 - ....}
https://www.stimulsoft.com/en/documenta ... er-manual/
Thank you.
Re: How to change expression use in jaspersoft?
Posted: Wed Dec 07, 2022 5:58 am
by Lord
I want to change my jasper report to Stimulsoft report
How to change this expression?
<code>$F{Total}.divide($V{Total},2,RoundingMode.HALF_UP)
</code>
In Stimulsoft Reports, you can use the Round function to achieve the same result as the expression above:
<code>Round($F{Total} / $V{Total}, 2, MidpointRounding.ToEven)
</code>
Re: How to change expression use in jaspersoft?
Posted: Wed Dec 07, 2022 7:35 am
by Lech Kulikowski
Hello,
You can use functions from the Dictionary -
decimal Round (decimal value, int decimals)
Rounds a decimal value to the nearest integer.
Parameters
value - A decimal number to be rounded.
decimals - The number of significant decimal places (precision) in the return value.
Also, in the NET-based products, you can use any NET Framework functions, fox example - Math.Round()
Thank you.