Page 1 of 1

Countif in a text box

Posted: Fri Mar 06, 2015 1:10 am
by Dwayne
Hi

I have little experience with stimulsoft so i'm not sure if i'm explaining this correctly. I have a list of kitchen cabinet names and I am trying to populate a Expression / Text box only if the cabinet name contains a certain word. Eg if the cabinet name is "wall 2 door" I want Something like this. If Product.Name contains the name "Wall" then it = "Upper cabinet" otherwise It will = "".

Thanks

Re: Countif in a text box

Posted: Fri Mar 06, 2015 10:22 am
by Alex K.
Hello,

Please try to use the following expression:

Code: Select all

{(Product.Name.Contains("Wall") ? "Upper cabinet" : "")}
Thank you.

Re: Countif in a text box

Posted: Sun Mar 08, 2015 5:22 pm
by Dwayne
Thanks for the help

I've tried the code but get the errors that I have attached.

Thanks

Re: Countif in a text box

Posted: Mon Mar 09, 2015 5:53 am
by Alex K.
Hello,

Please send us a sample report with test data which reproduce the issue for analysis.
Also please clarify which version are you use?

Thank you.

Re: Countif in a text box

Posted: Mon Mar 09, 2015 6:43 pm
by Dwayne
Hi
I'm not sure what version it is because its wrapped up inside another programme we use called microvellum. I've attached the file and high lighted the formula green

Thanks For your help

Re: Countif in a text box

Posted: Tue Mar 10, 2015 5:48 am
by HighAley
Hello.

Please, try to set the Script Language property of the report to CSharp.

Thank you.

Re: Countif in a text box

Posted: Tue Mar 10, 2015 5:33 pm
by Dwayne
Hi
That did the job thanks

Re: Countif in a text box

Posted: Wed Mar 11, 2015 3:59 am
by Andrew
Hello, Dwayne.

Thank you for the reply!

Re: Countif in a text box

Posted: Wed Mar 11, 2015 8:52 pm
by Dwayne
Hi
By switching the code from vb to c# I now have an error in my expression box.
This is the what I have in the expression box in a filter on my databand.
ProductsPrompts.Prompts.Name = "Toe_Kick_Height" AND ProductsPrompts.Prompts.Type = 3 AND ProductsPrompts.LinkIDSubassembly = ""
Can this be converted to C#

Thanks

Re: Countif in a text box

Posted: Thu Mar 12, 2015 6:14 am
by Alex K.
Hello,

Please try to use the following expression"

Code: Select all

ProductsPrompts.Prompts.Name == "Toe_Kick_Height" && ProductsPrompts.Prompts.Type == 3 && ProductsPrompts.LinkIDSubassembly == ""
Thank you.