Solved

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

Posted on 2013-01-14
5
414 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 101

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 101

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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 …
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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