Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mask first character 1

Status
Not open for further replies.

adhhealth

Programmer
Jul 1, 2004
165
US
My item number looks like RC010 RM987 etc..in a particular report I want to hide the first character "R" to show only C010, M987 etc..
 
hi
try
Right("your_field, 4)

cheers

pg

pgtek
 
some times the length of the item varies it could have a length of 5,6 or 7 also ..so i was thinking to change font color to white for the first character..(is it a good idea?) my help is not installed properly to look for the syntax..can u pl. suggest a way?
 
Try:

Mid({Table.ItemNumber}, 2)

That will return everything from the second character on.

-dave
 
Thanks alot that was helpful!!
I have a similar formatting to do..
for data in a field which is like b12-1,a32-12,z10-3 etc..I have to "bold" and have a bigger font for all the characters before the hyphen and have a smaller font without bold for characters after the hyphen..
thanks in advance!!
 
Create a formula like:

"<b>"+split({table.string},"-")[1]+"</b>"+"-" + split({table.string},"-")[2]

Then right click on the formula->format->field->paragraph->text interpretation->HTML text.

-LB
 

Hi,
I am getting the following error message:

Error in formula <fbinnum>. '"<b>"+split({@dsp_BINNUM},"-")[1]+"</b>"+"-" + split({@dsp_BINNUM},"-")[2] ' A subscript must be between 1 and the size of the array.

also I want font to be bigger so do i just introduce html like <font size=6></font> like <b></b> for bold??
 
You must have some occurrences without a hyphen or with only one element of the "two sides" of the field. Try:

if instr({@dsp_BINNUM},"-") <> 0 then
"<b><font size = 6>"+split({@dsp_BINNUM},"-")[1]+"</font size></b>"+"-" + split({@dsp_BINNUM},"-")[2] else
"<b><font size = 6>"+{@dsp_BINNUM}+"</font size></b>"

-LB

 
Wow - wouldn't it have been easier to create two formulas (one to break out the characters before the hyphen, and one to break out the characters after the hyphen) and then format them individually once they were dropped on the report canvas?

Peter Shirley
 
I have item numbers of the form "R-S01-A" R-V02-7A ETC,, In my report I want to hide the hyphen so that it looks like RSO1A RV027A ... can we do this?? I am v new to crystal pl. forgive for asking simple questions..thanks.
 
If you have 8.5 or higher, you can use:

replace({table.field},"-","")

In 8.0, using the "" causes the returned string to appear incorrectly. There is a workaround for it, but I don't recall what it is, and the search function is currently unavailable.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top