Wednesday, March 7, 2012

Crystal Equivalent in SQL 2K5?

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.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.
"jason.pileski@.pacourts.us" wrote:
> 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.
>

No comments:

Post a Comment