Pregunta

Estoy tratando de resaltar un campo cuando el valor tiene la palabra 'fecha límite' en él.Estoy tratando de usar la expresión:

=IIf(Fields!Notes.Value like "%deadline%","Yellow","Transparent")

en la propiedad BackgroundColor.

No está resaltando el campo (no cambiando el color de fondo).El campo 'Notas' es un tipo de datos de texto y estoy usando Informe Builder 3.0 si eso hace una diferencia.¿Qué estoy haciendo mal?

¿Fue útil?

Solución

SSRS does NOT use SQL syntax, but instead uses Visual Basic.

Use something like this:

=IIf(Fields!Notes.Value.IndexOf("deadline") >= 0,"Yellow","Transparent")

Or .Contains instead of .IndexOf

=IIf(Fields!Notes.Value.ToLowerInvariant().Contains("deadline"),"Yellow","Transparent")

Otros consejos

It is like in access: not '%' but '*':

=Fields!Notes.Value Like "*deadline*"

"InStr" works for me:

=IIF(InStr(Fields!Notes.Value,"deadline")>0, "Yellow", "Transparent") 

Remember that the compare value is case-sentive, so maybe use UCASE around:

=IIF(InStr(UCASE(Fields!Notes.Value),"DEADLINE"))>0, "Yellow", "Transparent") 

Why not use something like:

Fields!Notes.Value.Contains("deadline") 
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top