question

AsafOren-4835 avatar image
0 Votes"
AsafOren-4835 asked ·

Removing non AlphaNumeric values in SSRS

Hi People!
Is there a way to Remove non AlphaNumeric characters from a regular field in SSRS?
I can't do it in SQL, since the SQL procedure runs through a system that decrypts the data, and returns the value that I want to remove the AlphaNumeric characters from.

sql-server-reporting-services
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Zoehui-MSFT avatar image
0 Votes"
Zoehui-MSFT answered ·

Hi @AsafOren-4835,

You may use the custom code to meet your requirement.

Code is like below:

   Public Function AlphaNumeric(str As String) As String
     Dim i As Integer
    
     For i = 1 To Len(str)
         If InStr(1, "01234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz. ", Mid(str, i, 1)) Then AlphaNumeric = AlphaNumeric & Mid(str, i, 1)
     Next
 End Function

And then use =Code.AlphaNumeric(Fields!Yourdata.Value)

Please refer add-code-to-a-report-ssrs to use custom functions in SSRS.

If I misunderstand your needs, please incorrect me.
Regards,
Zoe


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

What can I do if my transaction log is full?--- Hot issues November

How to convert Profiler trace into a SQL Server table -- Hot issues November



·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AsafOren-4835 avatar image
0 Votes"
AsafOren-4835 answered ·

OMG Zoe, you're absolutely brilliant!
Worked like a charm!
Thank you!
If I could accept this answer a 1,000 times, I would :)

· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

😁😁It's my pleasure!

0 Votes 0 ·