Page 1 of 1

Conditional DataBind

Posted: Fri Jul 28, 2006 7:52 am
by Claudio Maccari
How can I bind a field with conditionaly ?
For example:

if(Foo.InvoiceAddress == "1")
{
//I need to print on the document the field Foo.Address1
}
else
{
//I need to print on the document the field Foo.Address2
}

Thk

Conditional DataBind

Posted: Fri Jul 28, 2006 9:01 am
by Edward
guest1 wrote:How can I bind a field with conditionaly ?
For example:

if(Foo.InvoiceAddress == "1")
{
//I need to print on the document the field Foo.Address1
}
else
{
//I need to print on the document the field Foo.Address2
}

Thk
Please use following code in BeforePrintEvent of StiText component

Code: Select all

if (Foo.InvoiceAddress == "1")
Text2.TextValue = Foo.Address1;
else
Text2.TextValue = Foo.Address2;
Thanks!