use a formula for field

Stimulsoft Reports.NET discussion
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

use a formula for field

Post by majidsoft »

HI
when i use a crystaL REPORT I USE THIS CODE IN FORMULA FIELD TO MANAGE FIELD now i want to know how to use this code in stimul report

Code: Select all

if {rest.rest}=1 then
'day'
else if {rest.rest}=2 then
'none'
else if {rest.rest}=3 then
'night'
with thanks
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

use a formula for field

Post by Jan »

Hello,

You can use following expression:

Code: Select all

{Choose(rest.rest, "day", "none", "night")}
Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

use a formula for field

Post by majidsoft »

thanks for your help
i have another question if i have a three chekbox in a report and want to chek on of them with chose command what i must doing
{Choose(rest.rest,checkbox1.checked,checkbox2.checked, checkbox3.checked)}
something like this
thanks for your attention
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

use a formula for field

Post by Jan »

Hello,

Can you explain in more details where in report you have checkboxes and what you want to do with it?

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

use a formula for field

Post by majidsoft »

hi
i explain it with programing language
if rest.rest=1 then checkbox1.checked=true
else if rest.rest=2 then checkbox2.checked=true
else if rest.rest=3 then checkbox3.checked=true
thank for your help
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

use a formula for field

Post by Jan »

Hello,

As i understand you need checked some of CheckBox component? In this case you can use following expressions in each of components:

CheckBox1.Checked:

Code: Select all

{rest.rest==1}
CheckBox2.Checked:

Code: Select all

{rest.rest==2}
CheckBox3.Checked:

Code: Select all

{rest.rest==3}

Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

use a formula for field

Post by majidsoft »

thank you
i create a text box that include a code in that "{Choose(rest.rest, 0, 1, 0)}"
i create this text box in databand if rest.rest is equal to 2 th texte box show 1 in other situation text box show 0 number now i want to count the text box that have 1 on it but when i write a text box in footer i see a error that say a text box is not member "i want to count that text box have a 1 on it"
thank
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

use a formula for field

Post by Jan »

Hello,

You can use following expression in footer:

Code: Select all

{Sum(Choose(rest.rest, 0, 1, 0))}
Thank you.
majidsoft
Posts: 66
Joined: Fri May 07, 2010 6:54 am

use a formula for field

Post by majidsoft »

hi
i use your code in text box in a footer but the error say "choose" not declare
thanks
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

use a formula for field

Post by Jan »

Hello,

Please get latest prerelease build from our website or use following expression:

Code: Select all

{Sum(rest.rest == 2 ? 1 : 0)}
Thank you.

Post Reply