Page 1 of 1

Conditional High-lighting

Posted: Thu Jun 07, 2007 6:18 am
by mbrahman
Hi Advanced Users,

I am new to the report writer. I am working on a report which requires me to get the number of days delayed between order shipment date and required date and have got the results correct and need to change the calculated field value to be printed in RED color when it is more than 0 days.

I have done the following to get the value:

Edit Calculated Column - Pop-up
(timespan) Days = Order_Details.Orders.ShippedDate-Order_Details.Orders.RequiredDate

RESULT e.g... 5.00:00:00 (Where it is 5 days and time 00:00:00 then I converted the result with the following :-

Edit Calculated Column - Pop-up
(decimal) newDays = Order_Details.Days.Days

RESULT e.g.. 5 now...... the problem I face is since the result value is 5 which is above 0 days as per requirements I defined the Condition in the field properties to change the printing color of the value to be in RED when it is greater then 0 but nothing happens to the color !

Could you kindly help

Thank You.



Conditional High-lighting

Posted: Fri Jun 08, 2007 2:44 am
by Edward
The goal you need to achieve may be reached in the following way:

1. Add an Calculated column of the decimal type with the following expression inside:

(Orders["ShippedDate"] is System.DBNull)||(Orders["ShippedDate"] is System.DBNull)?0M:(decimal)((Orders.RequiredDate-Orders.ShippedDate).Days)

The name of the column will be for example Days.

2. Place the resulted calculated column in the StiText component on the DataBand:
{Orders.Days}

3. For that StiText component in the HighLightCondition property of it you can define the following expression:

Orders.Days<0

Also you should define a Red color for the Text in the HighLightCondition. This color will be set for the Font of the StiText component if the Condition succeeds.

You may also see an example report in the attachment. This report may be opened in the Demo sample Application from the standard delivery.

Thank you.

Conditional High-lighting

Posted: Sat Jun 09, 2007 4:50 am
by mbrahman
:biggrin:

Hi Edward,

Thank you for the solution and really appreciate the prompt reply, and it works very well and also thanks for the sample report, from which I also learned quite a few thing on displaying and condition the proper parent-child calculated fiel

Conditional High-lighting

Posted: Mon Jun 11, 2007 7:49 am
by Edward
Thank you for the good words.

We always try to do our best for our customers!

Thank you.