Page 1 of 1
select in text
Posted: Wed Jan 20, 2010 4:42 am
by ely
Hi
I have a textbox in a databand whit datasourse x
I want this textbox's value be equal whit (if y select tb1.f1 else select tb2.f1)
Is it possible?
tanks
select in text
Posted: Wed Jan 20, 2010 5:49 am
by Edward
Hi
Yes, that is possible. Please write the following expression in Text property:
{Condition?tb1.f1:tb2.f1)
Thank you.
select in text
Posted: Sat Jan 23, 2010 12:15 am
by ely
Hi and thanks Edward
I try your solution but it works just for first value,for example see:
table x:
f1
1
2
table t1:
f1 f2
1 100
2 200
table t2:
f1 f2
3 100
4 200
{x.f1>1?t1.f1:t2.f1}
but it always return t2.f1.
and one more thing: My text datasourse is table X.

and another question:I want one of my text's value={t1.f2*int.pars(Text1.Text)}
but the result is a message:"Expression in text property of 'Text2' can't be evaluated".I searched and found one like this the answer was to replace Text1.Text with a number
but I can't because Text1.text related to my condition(first question)
select in text
Posted: Mon Jan 25, 2010 8:28 am
by Edward
Hi
The reason why your condition did not work might be the fact that there are two different datasources were being used in one databand. So the second table was in the same position for all rendered with help of the databand rows.
And if you need to calculate several values which depend on each other, please use Dictionary Variables or assign values to text components in BeforePrintEvent of the DataBand to Text1.TextValue property.
Thank you.