Solved

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

Posted on 2013-01-14
5
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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