Friday, March 30, 2012

Putting Multiple Field data in a report table cell

I'm using report designer and Visual Studio .net 2003. I have a table in the report and would like to put multiple field values in a single cell. Something along the lines of this in the cell: =Fields!Phone.Value, Fields!.Fax.Value.

I don't know how to seperate the values to get them to work in the same table cell. I've tried commas, semi colons, spaces, parens.

How would I do this?=Fields!Phone.Value & " " & Fields!Fax.Value should work.
|||Great that works!

One other question, if I put a symbol (comma, semicolon) in the between the ampersands, how do I get it to leave the cell blank if there is nothing stored in the fields?

For example, say I have =Fields!Phone.Value & ", " & Fields!Fax.Value in the cell but when there is no values for those fields the cell is ", ".|||=Fields!Phone.Value & ISNULL(Fields!Fax.Value,"",",") & Fields!Fax.Value should work?
Otherwise you can try using IIF.
|||I couldn't use IsNull because it says it is not decleared. I can use IIF, so the correct code is =Fields!Phone.Value & IIF(Fields!Fax.Value=nothing,"",",") & Fields!Fax.Value

Thanks for your help.

sql

No comments:

Post a Comment