Having Trouble checking is a variable it greater then something.

Stimulsoft Ultimate discussion
Post Reply
David334
Posts: 29
Joined: Tue Jul 16, 2019 6:45 pm

Having Trouble checking is a variable it greater then something.

Post by David334 »

I am trying to check if a variable is greater than a number. It seems to be treating them as strings.

I have a variable "day" defined as a long type with an expression: DayOfYear(StrToDateTime(date_as_string)) <----- This is "supposed" to output as a long value.
Lets say for example the above returns 31 as a result.

I am trying to check if this "long" variable is greater than a number : {day>30?"greater","less"} this doesnt print anything.
So I tried just adding to it: {day+5}, but this outputs 315 and not 36 like I would expect.

Can someone help me with what I am doing wrong?

Thanks.
Lech Kulikowski
Posts: 6092
Joined: Tue Mar 20, 2018 5:34 am

Re: Having Trouble checking is a variable it greater then something.

Post by Lech Kulikowski »

Hello,

Please send us a sample report that reproduces the issue for analysis.

Thank you.
David334
Posts: 29
Joined: Tue Jul 16, 2019 6:45 pm

Re: Having Trouble checking is a variable it greater then something.

Post by David334 »

Im not sure what format these reports are in. Its bundled with our shop software Jobboss2.
When I export it, I get a file extension of .cff. When I try to attach it, its says invalid.
Lech Kulikowski
Posts: 6092
Joined: Tue Mar 20, 2018 5:34 am

Re: Having Trouble checking is a variable it greater then something.

Post by Lech Kulikowski »

Hello,

> Its bundled with our shop software Jobboss2.

In that case, you should send your request to Jobboss2 developers, we do not know how they used our components in this application.

Thank you.
David334
Posts: 29
Joined: Tue Jul 16, 2019 6:45 pm

Re: Having Trouble checking is a variable it greater then something.

Post by David334 »

I'm only posting this for someone else who might run into this.
The solution was to use "Convert. " to convert to a usable number. I ended up converting to Double using Convert.ToDouble( ) and it worked as expected.

This is a programming issue and a lack of knowledge problem on my part, that I resolved no thanks to Lech.
Max Shamanov
Posts: 725
Joined: Tue Sep 07, 2021 10:11 am

Re: Having Trouble checking is a variable it greater then something.

Post by Max Shamanov »

Hello,

You are Welcome!
Post Reply