Bob_Sullivan


I'm trying to use the following as an expression in the format of a text box. (Reporting Services 2005)

=System.Text.RegularExpressions.Regex.Replace(First(Fields!JOB_NBR.Value, "main"), "(\w{2})(\w{4})(\w{1})","$1-$2-$3")

however in the edit expression window, I have a red line under the word Replace.

The mouse over tells me it is a "unrecognized identifier"

Any idea's





Re: formating a text field using regular expression

BobP - BIM


I believe that SSRS does not see the members of external references, and treats them as an error in editor, but the report should run.

BobP







Re: formating a text field using regular expression

Bob_Sullivan

The report did run ok however the formating was not applied.

The expression should take a seven character string e.g. A703E40

and

format it to A7-03E4-0

I believe the expression is written correctly, but will review it again.

thanks







Re: formating a text field using regular expression

Yao-Jie Tang - MSFT

Hi Bob,

I have tested this expression on the Report Server. It does work well. I have a red line, too, because SYSTEM.TEXT is not a built-in Class in Reporting Services.

First, please make sure that you have installed the latest Service Pack for Reporting Services 2005 and Visual Studio.

If the problem still exists, try to replace ¡°First(Fields!JOB_NBR,Value,¡±main¡±)¡± with ¡°A7034E0¡±. The expression ¡°First(Fields!JOB_NBR.Value,¡±main¡±)¡± may cause the problem.

Please post back if the solution doesn¡¯t help. I¡¯m waiting here to provide further assistance.

Thanks






Re: formating a text field using regular expression

Bob_Sullivan

Thanks for your help, you got me to thinking and I realized I put the expression into the format field for the textbox

instead of the value field.

Once it was in the value field everything works fine now.

thanks again.