How do I remove all characters besides alpha or numeric, just the special characters in Process Payment?
Currently one of the lines Expr is this: reportitems!txtAddline21.Value
How do I remove all characters besides alpha or numeric, just the special characters in Process Payment?
Currently one of the lines Expr is this: reportitems!txtAddline21.Value
If you know which ones (tabs, carriage returns, line feeds, etc…) you can use the REPLACE function. The following removes the tab char.
Replace(reportitems!txtAddline21.Value, Chr(7),"")
You can nest the replace function to do multiple characters.
The following replaces tab, CR, and LF with a single space.
Replace(Replace(Replace(reportitems!txtAddline21.Value, Chr(7)," "),Chr(13)," "), Chr(10), " ")
If you really need to remove all non-alphanumerics, that’s going to be an incredible deep nesting of Replaces.
Maybe someone else here knows how to use Regex in SSRS reports.
FWIW - The regex solution would be:
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
return (rgx.Replace(reportitems!txtAddline21.Value, ""));
That leaves any letter (upper or lower case), any digit, spaces, and dashes. Removing all others.
@Will79 -
Thanks to the Googles …
the expression you want is
=System.Text.RegularExpressions.Regex.Replace(reportitems!txtAddline21.Value, "[^a-zA-Z0-9 -]", "")
The "[^a-zA-Z0-9 -]"
part means any character except the range of a-z, A-Z,0-9, < space >, or < dash >
I guess I am looking at the wrong ssrs report. I am trying to find the one that is for the AP Payment Entry–>Process Payments–>;Print. If that is the process payments one and it is in the APCheck for Report style, then it still pulling the standard when I have it pointed at the custom.