Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-01-14
5
Medium Priority
?
416 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 668 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 1332 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 1332 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

772 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