Problem generating expression

Stimulsoft Reports.WEB discussion
Post Reply
Nicolai_Petrov
Posts: 11
Joined: Mon Jun 25, 2012 10:50 am

Problem generating expression

Post by Nicolai_Petrov »

Hello,

I'm triying to make the logic for evaluating a database field and depending if the value is 0,1,2,3 or 4 assign to the text label the value of variable1, variable2, variable3, variable4 or variable5 respectively.

The code i'm triying in vb.net is:

IIF {Cabecera.TDoc} = 0,{Variable1},IIF {Cabecera.TDoc} = 1,{Variable2},IIF {Cabecera.TDoc} = 2,{Variable3},IIF {Cabecera.TDoc} = 3,{Variable4},IIF {Cabecera.TDoc} = 4,{Variable5},'Error'

I know this is not correct, could you tell me what i'm missing?

Thanks,

Nico.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Problem generating expression

Post by HighAley »

Hello.
Nicolai_Petrov wrote:I'm triying to make the logic for evaluating a database field and depending if the value is 0,1,2,3 or 4 assign to the text label the value of variable1, variable2, variable3, variable4 or variable5 respectively.

The code i'm triying in vb.net is:

IIF {Cabecera.TDoc} = 0,{Variable1},IIF {Cabecera.TDoc} = 1,{Variable2},IIF {Cabecera.TDoc} = 2,{Variable3},IIF {Cabecera.TDoc} = 3,{Variable4},IIF {Cabecera.TDoc} = 4,{Variable5},'Error'

I know this is not correct, could you tell me what i'm missing?
You should use Choose (index, choice1, choice2, ...) function or if you have complex condition use Switch (condition1, value1, condition2, value2, ...)
You could find description of these functions in our documentation.

Thank you.
Post Reply