Sunteți pe pagina 1din 2

First of all, what is CHR?

Each character has an associated ASCII value to it. To find ASCII value of a string
we will simply use the function ASCII(‘A’or ‘a’….)

If we have the ASCII value and want to find the corresponding character then we use
CHR(ASCII#). For example, CHR(65) returns ‘A’. We can execure CHR(ASCII#) and
ASCII('character for ascii') in ORACLE database and get the corresponding values.
In Crystal Reports CHR() is replaced by CHRW().

Below are the important values which would be handy right from SQR to Crystal
Reports in several occasions:

 Character 8 - Chr(8): Backspace


 Character 9 - Chr(9): Tab (vbTab)
 Character 10 - Chr(10): Line Feed Return (vbLf)
 Character 11 - Chr(11): Shift+Enter (vbVerticalTab)
 Character 12 - Chr(12): Page Break (vbFormFeed)
 Character 13 - Chr(13): Carriage Return
 Character 14 - Chr(14): Column Break
 Character 15 - Chr(15): Shift In
 Character 32 - Chr(32): Space

A very simple example: Usage of "Jan" + CHR(10) + "20th" in a Crystal formula


displays the below:
Jan
20th

These two functions can be used in any programming language(I firmly believe
unless a very old crap programming language/legacy system doesn't).

For my requirement in Crystal Reports, I wrote the required IFs and FORs in Crystal
Syntax and used CHRW(32), CHRW(10), CHRW(12) and CHRW(13) to meet my
customization needs. Here is the link VB_Chr_Values where CHR and ASCII values
are found from 1 to 255. Few of them work only with VB or behave differently with
VB.

This post sounds simple even for me; however considering the time I had
vetted(after forgetting) to find the required ASCII numbers to be passed in CHRW()
function in Crystal and VB syntax, I think this is worth a post that could save my time
in future.

 Share This:
 Facebook
 Twitter
 Google+
 Stumble
 Digg

Email ThisBlogThis!Share to TwitterShare to Facebook


Related Posts:

 Displaying a message if data in same group(Crystal Report)


breaks into multiple pagesIn Crystal Reports, group header can be repeated
in each page if the group is spanning to pages. However, what if user wants a
custom message like, 'd… Read More

 CHR and ASCII values useful in Crystal Reports, SQR, VB,


Oracle.....Recently my friend told me a requirement in Crystal Reports
where he had to induce carriage return and line breaks based on a business
logic which was… Read More

 Changing Size of a Crystal Report to custom sizes beyond the size


allowed in the local configured printerOften in Crystal Reports, the width of the
page needs to be set to varying and custom sizes. By default, the sizes
available for any Crystal Report is… Read More

 Rakesh Parwal's PeopleSoft Admin Blog: Configuring Report


Manager - List/ExplorerRakesh Parwal's PeopleSoft Admin Blog: Configuring
Report Manager - List/Explorer… Read More

 How to Configure Crystal Reports in PeopleSoft?Configuration of


Crystal Reports in PeopleSoft: From PeopleSoft PIA environment in which
Crystal Reports need to be configured, access 'Configure' co… Read More

S-ar putea să vă placă și