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

CHR() in report expression give error

3 Answers 241 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carla
Top achievements
Rank 1
Carla asked on 14 Feb 2012, 05:32 PM
i am trying to do a conditional statement in a report that results in a

chr(0252) or a

chr(0251) as the result.  a "x" or a checkmark in wingding font.  using telerik latest reporting and VS 2010.  this works in ssrs vs 2008 but not in telerik.  it does not recognizt the CHR()

An error has occurred while processing TextBox 'textBox87':

The expression contains undefined function call chr().

 
how do yuo do this in telerik reporting?  need this asap

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 14 Feb 2012, 08:39 PM
Hi Carla,

There is no built-in function to handle the wingding character and display it. However you can manually do this by opening the expression editor, holding Alt and keying the desired number e.g. Alt + 0251.

Greetings,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Carla
Top achievements
Rank 1
answered on 22 Feb 2012, 04:20 PM
holding alt and keying the number does nothing.  this does not solve my issue.  i have a conditional statement that either has to display the checkmark or the "x"
0
Elian
Telerik team
answered on 27 Feb 2012, 02:22 PM
Hi Carla,

What my colleague meant, was to type in the characters in the expression directly, instead of using a function that will create them by their code. Something like:

=IIF(Fields.Item % 2 = 1,  '✔', '✘')
See screenshot for result.

Kind regards,
Elian
the Telerik team
NEW in Q1'12: Telerik Report Designer (Beta) for ad-hoc report creation. Download as part of Telerik Reporting Q1 2012. For questions and feedback, use the new Telerik Report Designer Forum.
Patrick
Top achievements
Rank 2
commented on 23 Sep 2022, 06:43 PM

ou can solve this context as follows:

On the text box you want to see a checkbox, with or without a checkmark, you must perform a binding to the following property path: Style.Font.Name. You assign the following expression: =iif(Fields.BooleanField , "wingdings 2", "wingdings")
On the expression of the text field, you put : = IIF(Fields.BooleanField=1, "R", "o")
So when the boolean field has a value of 1, it changes the font to "wingdings 2", otherwise it is set to the font name "wingdings".  At the same time, the true value returns the letter "R" in "windings 2" or the letter "o" under the font "windings". 

You can adapt it to a much wider context by simply changing the font name or any other character that returns the desired element. In addition, you have a very portable and lightweight document, with a resolution that matches the media used.
Tags
General Discussions
Asked by
Carla
Top achievements
Rank 1
Answers by
Steve
Telerik team
Carla
Top achievements
Rank 1
Elian
Telerik team
Share this question
or