Page 1 of 3

use a formula for field

Posted: Tue May 11, 2010 3:36 pm
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

use a formula for field

Posted: Wed May 12, 2010 12:59 am
by Jan
Hello,

You can use following expression:

Code: Select all

{Choose(rest.rest, "day", "none", "night")}
Thank you.

use a formula for field

Posted: Wed May 12, 2010 9:06 am
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

use a formula for field

Posted: Thu May 13, 2010 2:09 am
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.

use a formula for field

Posted: Thu May 13, 2010 7:59 am
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

use a formula for field

Posted: Fri May 14, 2010 1:02 am
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.

use a formula for field

Posted: Fri May 14, 2010 3:44 am
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

use a formula for field

Posted: Fri May 14, 2010 8:11 am
by Jan
Hello,

You can use following expression in footer:

Code: Select all

{Sum(Choose(rest.rest, 0, 1, 0))}
Thank you.

use a formula for field

Posted: Fri May 14, 2010 8:32 am
by majidsoft
hi
i use your code in text box in a footer but the error say "choose" not declare
thanks

use a formula for field

Posted: Sat May 15, 2010 7:02 am
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.