Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ReportViewer controlling nulls

Status
Not open for further replies.

prrm333

Programmer
Apr 14, 2003
97
US
I am able using an expression to output a phone number in the (###) ### - #### format and if the field is blank I end up with () -. I would like to using an expression like Crystal Report show nothing if the field is blank. How do I do this?

Also does anyone have a good tutorial on using ReportViewer to create labels similar to Crystal Reports?

Thanks.
 
You need to do this in the report item's expression.

OTOMH something like:

Code:
=IIf(blah = "", "", String.Format(”{0:(###) ###-####}”, blah))

Since this issue is with the Report itself (not the report viewer) I'd suggest trying this forum next time: forum1462

Hope it helps,

Alex

[small]----signature below----[/small]
The author of the monograph, a native of Schenectady, New York, was said by some to have had the highest I.Q. of all the war criminals who were made to face a death by hanging. So it goes.

My Crummy Web Page
 
Thanks for the info, I modified it to the following:

=IIf(Fields!HPhone.Value = "", "", ("(" & Left(Fields!HPhone.Value,3) & ")" & " " & Mid(Fields!HPhone.Value,4,3) & "-" & Right(Fields!HPhone.Value,4)))

But using your code I got the start I needed. I also found the Reporting Service Forum and I'm using that too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top