This is a migrated thread and some comments may be shown as answers.

data formatting sintax

5 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michele
Top achievements
Rank 2
Michele asked on 28 Aug 2009, 11:27 AM
Hello,
how do I set in the textbox value the sintax to have a conditional formatting of this type :

if(Field.Valore ==1) then 'yes' else 'no' ?

thanks in advance
Paolo

5 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 28 Aug 2009, 12:48 PM
Hi Paolo,

You can use the IIF function in the Edit Expression Dialog directly for such purposes, e.g.:

= IIf(Fields.CAMPO = 1, 'Yes', 'No')

Kind regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
David Purkey
Top achievements
Rank 1
answered on 10 Mar 2010, 06:12 PM
I am looking for some documentation on the edit expression dialog box - specifically using the logical operators to conditionally format a report field.  I would like to check a data field for a list of specific values and if data contains one of the values - the cell should have a different background color.
0
Peter
Telerik team
answered on 12 Mar 2010, 04:06 PM
Hello David Purkey,

There are two approaches to achieve such task:

  • As you had mentioned Conditional Formatting may be one of the solutions.
  • Another approach includes Bindings that we had introduced with Telerik Reporting Q1 2010.

I have attached a sample project that shows how to accomplish your task with Conditional Formatting and Bindings.

Kind regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
David Purkey
Top achievements
Rank 1
answered on 12 Mar 2010, 04:51 PM
Thank you Peter
I appreciate the code for the solution - however there are a couple issues that will have to be resolved before I can even open your examples - the biggest of which is we are not a sql server house so the database referenced in your example does not exist in my shop.
We use an xml web service for all our data and not direct data connections to databases.  But that is not a real issue


Here is what I am looking for in more detail:

In the telerik documentation the Edit Expression Dialog example shows a simple arithmetic calculation - a value from a database field times a multiplier.

There are other available operators for conditional formatting - I am looking for examples of these other operations such as the logical.

Specifically - I need to format a report field based on a number of pre-set text values from a database (i.e. "Open", "Closed", "Canceled" ect) - so for example if the value is Closed OR Canceled the field should have a different background color than when the value is Open.
What would be the recommended way to accomplish this using the logical operations in the conditional formatting expression?

David
0
Peter
Telerik team
answered on 15 Mar 2010, 11:18 AM
Hello David Purkey,

I had used the AdventureWorks sample database which comes with every installation of our product.
Nevertheless I have modified the sample to use a Business Object instead of a database.

Regards,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Michele
Top achievements
Rank 2
Answers by
Steve
Telerik team
David Purkey
Top achievements
Rank 1
Peter
Telerik team
Share this question
or