0

I have a report in SSRS 2008 and I want to combine some strings. I know you can write some code in SSRS to do this, but I'm not really sure how.

So basically I have the value "FullName" and I want to make it so it is FullName, FullName, FullName for the appropriate row. I am pulling the info from the appointment table using FetchXML. Any ideas on how to go about doing this?

EDIT: Make things clearer.

So I am querying from the appointment table and each appointment has more than one FullName, but they are in different rows in the Query. I want to combine them into the row they belong in the report

Thanks!

  • I'm unsure about what you are asking here. You want to group on some other field and display a coma separated list of `fullname` related to that group field? So if John, Jim and Rambo are of type 'soldier', you want to display a row with 'soldier : John, Jim, Rambo'? – Dominic Goulet Dec 02 '11 at 21:14
  • So I am querying from the appointment table and each appointment has more than one FullName, but they are in different rows in the Query. I want to combine them into the row they belong in the report. –  Dec 02 '11 at 21:19

3 Answers3

0
=String.Format("{0}, {1}, {2}", Fields!FirstName.Value, Fields!FirstName.Value, Fields!FirstName.Value);

You can find more code expressions for SSRS here

Just remember it uses VB.NET for its coding syntax. You can also embed custom code in your reports for more complex operations

Evan Larsen
  • 9,935
  • 4
  • 46
  • 60
0

You should be able to use the JOIN function if you're attempting to put together a list of parameters. Otherwise you would have to do it in the SQL with the STUFF function

http://lukehayler.com/2009/08/the-join-function-in-ssrs/

http://msdn.microsoft.com/en-us/library/ms188043.aspx

msmucker0527
  • 5,164
  • 2
  • 22
  • 36
0

See the answers to this question for details of how to concatenate values into a string across rows in SQLServer.

Community
  • 1
  • 1