We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to apply styling to a value using Expressions

Thread ID:

Created:

Updated:

Platform:

Replies:

129043 Feb 22,2017 10:58 PM Feb 28,2017 04:23 AM Report Platform 5
loading
Tags: Report Designer
Ernawita Hamidon
Asked On February 22, 2017 10:58 PM

Hi

In report designer, is it possible to apply styling to a table cell value (from dataset) using Expressions?

For example, data set returns the records below, and if it contains the word "total", I would like the value to be bold.

Apple                              10
Pear                                 15
Orange                            7
Fruits Total                     32
Pepsi                                20
Sprite                               8
Beverage Total               28

I tried using Format() in Expressions but it does not seem to extend to text styling.

Thank you.

Regards
Erna

Vinoth Srinivasan [Syncfusion]
Replied On February 24, 2017 07:07 AM

Hi Ernawita, 
 
Thanks for contacting Syncfusion support. 
 
Yes, the style can be applied/modified to specific cell based on its current value using expression. You need to set following expression to “Font Weight” property of the tablix cell using property window by selecting the entire row. 
 
=IIf(LCase(Fields!Items.Value).ToString().Contains("total"), "Bold", "Default") 
 
We have prepared a simple report based on your requirement and it can be downloaded from the below location. 
 
Regards, 
Vinoth S. 


Ernawita Hamidon
Replied On February 26, 2017 10:41 PM

Hi Vinoth

Thank you for your reply.

I tried using your sample report but I get this error message: "An error occurred while processing the report item 'Items' and Invalid Expression : ". When I remove the font weight expression from the row and set to Default, I am able to preview the report.

Please see attached file for the screenshot of the error: 1.png is the error when font weight property expression is in place, and 2.png is the successful preview without the font weight property expression.

I have tried on my own report too and I get the same invalid expression error.

Appreciate your help to look into this. Thank you.

Regards
Erna


Attachment: Img_18212c1e.rar

Vinoth Srinivasan [Syncfusion]
Replied On February 27, 2017 04:47 AM

  
Hi Ernawita, 
 
We could run the styling expression report without any exception at our end, please find the snapshot below.  
 
 
 
We request you to share the assembly version used at your end, it will help to provide the solution at the earliest. 
 
Regards, 
Vinoth S. 


Ernawita Hamidon
Replied On February 27, 2017 04:56 AM

Hi Vinoth

I am using report designer version 1.1.0.107.

Regards
Erna

Vinoth Srinivasan [Syncfusion]
Replied On February 28, 2017 04:23 AM

Hi Ernawita, 

A support incident has been created under your account. Please log on to our support website to check for further updates. 


Regards, 
Vinoth S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;