Conditional DataBind

Stimulsoft Reports.NET discussion
Post Reply
Claudio Maccari
Posts: 12
Joined: Fri Jun 09, 2006 11:53 am
Location: Italy

Conditional DataBind

Post 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
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Conditional DataBind

Post 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!
Post Reply