Conditional Formatting using a Calculated Column as the condition

Stimulsoft Reports.WEB discussion
Post Reply
KDurham
Posts: 5
Joined: Thu Jul 02, 2020 6:30 pm

Conditional Formatting using a Calculated Column as the condition

Post by KDurham »

Greetings...Newbie here with Stimulsoft.

I created a calculated column in a report and I fill this field using the DatDiff function. The field is populated with the number of days on the report...as expected. Now I want to use that calculated value in a conditional formatting process to format another field on the report called scheduled ship date.

If the calculated field is, say, 5 or less, then I want the scheduled ship date to be RED. If the calculated field is greater than 5 but less than 12, the ship date field should be colored YELLOW. You get the idea. A color code to show impending shipments.
I have not been able to make use of the value in the calculated column to make the conditional formatting work. This doesn't seem hard but......

Thanks
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Conditional Formatting using a Calculated Column as the condition

Post by HighAley »

Hello,

What expression do you use there?
The DateDiff() function returns TimeSpan, if you need to get days you should use an expression like this:

Code: Select all

DateDiff(Orders.RequiredDate, Orders.OrderDate).Days
Thank you.
KDurham
Posts: 5
Joined: Thu Jul 02, 2020 6:30 pm

Re: Conditional Formatting using a Calculated Column as the condition

Post by KDurham »

Yes. I did set the output to show the number of days as an integer. And it works. The new field shows the number of days to shipment and now I want to use the number in that calculated field as the basis for my conditional formatting. If the number of days is less than say 4, make the color of the ship date turn RED or something. The formatting part is not the problem. My sticking point is when I set up the conditions for the ship date field for the color change, how do I get rule to look at the value in the calculated field so that if makes the correct decision to color RED or not?
KDurham
Posts: 5
Joined: Thu Jul 02, 2020 6:30 pm

Re: Conditional Formatting using a Calculated Column as the condition

Post by KDurham »

Another related question. I'm using E2 Shop. Can someone confirm the programming language used to program the Stimulsoft reports? Is is VB.Net or C#? I think it's VB.NET.
PS. I still haven't been able to change color of one field based on the output of an expression in another field.
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Conditional Formatting using a Calculated Column as the condition

Post by Andrew »

Hello,

Please confirm that all the issues you have are located in E2 Shop? This will help us give you the correct suggestion.

Waiting for your reply.
Thank you.
KDurham
Posts: 5
Joined: Thu Jul 02, 2020 6:30 pm

Re: Conditional Formatting using a Calculated Column as the condition

Post by KDurham »

yes. It's in the report writer of E2 shop. The menu path is: REPORTS / ORDERS / JOB SCHEDULE

The crude table below depicts what I'm trying to do.

DaysToShip is a calculated field and it is working. The output in days is correct.
What I want to do is have an expression or rule that looks at DayToShip. If the DaysToShip is less than or equal to 4 (or something), change the background of the DATE to RED.
If the DaysToShip is between 4 and 10, color the DATE background YELLOW.
You see the pattern. I want to give color cues to the shop workers.

At this time, the condition that I programmed does change the background color of the DATE. To avoid clashing with the rules and to let me sneak up on this, the rule is only supposed to change the colors if the DaysToShip are less than 10 but it does not recognize the integer in the DaysToShip field. All of DATE backgrounds are colored regardless of the integer value.

*** Could it be a timing thing here? In other words, the conditional rule is applied BEFORE the DaysToShip field gets calculated? The conditional rule evaluates the empty field as less than 10 and changes to color of the background.

DATE Days to Ship
07/10/2020 3
07/13/2020 6

Thanks for your time and help on this.
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Conditional Formatting using a Calculated Column as the condition

Post by Andrew »

Hello,

Thank you for the clarification.

Shoptech uses our Stimulsoft Reports tool, but we are not aware how. Please ask the Shoptech support to resolve your issue. They have modified our tool, even changed the file extension. So we cannot help yu in this.

Thank you for understanding and stay safe.
KDurham
Posts: 5
Joined: Thu Jul 02, 2020 6:30 pm

Re: Conditional Formatting using a Calculated Column as the condition

Post by KDurham »

Andrew,
Thanks for the reply. If we ignore the ShopTech entanglement, do you have any input about a solution or path to a solution if this question were asked about the Stimulsoft product? I'm thinking that the action I'm trying to accomplish would be below the level of changes needed for a product integration. In the Stimulsoft report feature, is there a way to use the output of a calculated field the conditional rules for another column? Even if there were radical changes done by Shoptech, I might get some benefit and ask them a more focused question.
Thanks and Regards
Lech Kulikowski
Posts: 6245
Joined: Tue Mar 20, 2018 5:34 am

Re: Conditional Formatting using a Calculated Column as the condition

Post by Lech Kulikowski »

Hello,

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

Thank you.
Post Reply