Friday, March 9, 2012

Expression to alter the font size

I'm trying to use an expressions like these to alter the font size...
iif(Len(Fields!MyField.Value) > 12, "7pt","8pt")
iif(Len(Fields!MyField.Value) > 12, 7pt,8pt")
iif(Len(Fields!MyField.Value) > 12, 7,8)
Regardless of which expression I use, I get this error:
"<my expression> cannot be parsed as a unit because it does not contain
numeric values. Examples of valid unit strings are "1pt" and ".5in".
Any suggestions on how i can check the length of a string and alter the
font size in the table?
Thanks,
James
--This worked for me, =iif(Len(Fields!MyField.Value)>12,"7pt","8pt"). Make
sure that you are putting the expression in the FontSize property with the =.
daw
"James" wrote:
> I'm trying to use an expressions like these to alter the font size...
> iif(Len(Fields!MyField.Value) > 12, "7pt","8pt")
> iif(Len(Fields!MyField.Value) > 12, 7pt,8pt")
> iif(Len(Fields!MyField.Value) > 12, 7,8)
> Regardless of which expression I use, I get this error:
> "<my expression> cannot be parsed as a unit because it does not contain
> numeric values. Examples of valid unit strings are "1pt" and ".5in".
> Any suggestions on how i can check the length of a string and alter the
> font size in the table?
> Thanks,
> James
> --
>

No comments:

Post a Comment