Solved

How to mask the some of the characters in Databasefield - Crystal Reports

Posted on 2013-01-14
5
412 Views
Last Modified: 2013-01-25
Hi,
I have a Database field in the Crystal report. It can be 16 to 20 characters length. I want to mask
all the characters with X except last four characters.

It can be ex:xxxxxxxxxxxx1234 or xxxxxxxxxxxxxxx3456

How to do this in Crystal 11.

Thanks
0
Comment
Question by:KavyaVS
  • 2
  • 2
5 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 167 total points
ID: 38776448
Use a formula field...

if length({table.field})=20 then
"xxxxxxxxxxxxxxxx" & right({table.field},4)
else
"xxxxxxxxxxxx" & right({table.field},4)
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 333 total points
ID: 38776473
Since it can be 16 TO 20 in length try

Right("xxxxxxxxxxxxxxxx" & right({table.field},4),Length({table.field}))

mlmcc
0
 

Author Comment

by:KavyaVS
ID: 38778559
Hi mlmcc,
It is working.But I want to know how it is working.
Right("xxxxxxxxxxxxxxxx" & right({table.field},4),Length({table.field}))


Thanks
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 333 total points
ID: 38779389
Not sure what you mean by how.

The formula adds the 4 characters you want to a string of 16 x's producing a 20 character string with the left 16 masked as x
    xxxxxxxxxxxxxxxx1234
It then takes the right substring of the appropriate length for display.

Peter's formula will work, he limited it to 16 and 20 character lengths.

mlmcc
0
 

Author Closing Comment

by:KavyaVS
ID: 38818807
Thanks.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question