Removing non AlphaNumeric values in SSRS

Asaf Oren 101 Reputation points
2021-03-02T20:03:11.897+00:00

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
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,849 questions
0 comments No comments
{count} votes

Accepted answer
  1. ZoeHui-MSFT 34,581 Reputation points
    2021-03-03T02:32:33.507+00:00

    Hi @Asaf Oren ,

    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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Asaf Oren 101 Reputation points
    2021-03-03T06:39:02.103+00:00

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