Groups | Blog | Home
all groups > sql server reporting services > february 2006 >

sql server reporting services : Crystal Equivalent in SQL 2K5?


jason.pileski NO[at]SPAM pacourts.us
2/13/2006 1:43:11 PM
I have an existing Crystal report that contains a subreport which lists
items across the page rather than down. The subreport has a Header and
Detail section, which are both supressed, and a footer section that is
visible. In the Header section, a field is defined with the following
expression:
WhilePrintingRecords;
global stringvar strItems;
strItems :=""

The Detail section has a field defined with the following expression:
WhilePrintingRecords;
global stringvar strItems;
strItems := strItems + ToText({uspGetItems;1.ItemID}, 0, "") + ", "

The Footer section has a field defined with the following expression:
WhilePrintingRecords;
global stringvar strItems;
If Len(strItems) > 1 Then
strItems := Left(strItems, Len(strItems) - 2)

Is there a way to do this in a SQL report?

Any feedback would be appreciated.

Thanks.
Wayne Snyder
2/14/2006 5:34:17 AM
You could do something like this in a data set in SQL


Declare @a varchar(1000)
Select @a = ''
select @a =@A + ISNULL(NAME + ', ','') FROM Production.Product
Select @a as myList

You'd need to take off the last , ....
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC

I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.


[quoted text, click to view]
AddThis Social Bookmark Button