One cell has to present few rows from grouping
well, data lools like
id sub_id text
1 2 test1
1 3 test1
1 4 test1
1 5 test1
2 2 test2
the report has to present data in the following format
1 2, 3, 4, 5 test1
1 2 test2
any ideas how to do it?
May 12th, 2011 12:45am
I have done it by subreport, you can put subreport into cell
but I'm interested in other ideas
Free Windows Admin Tool Kit Click here and download it now
May 12th, 2011 1:55am
Hi
ArtemB,
I suggest you can use T-SQL to gain this format.
First, create a function in your database to get sub_id based on id like following,
CREATE
FUNCTION [dbo].[GetSubIDs]
(
@ID NVARCHAR(20)
)
RETURNS
NVARCHAR(2550)
AS
BEGIN
DECLARE @strSubIDs
NVARCHAR(2550)
SET @strSubIDs =
''
SELECT @strSubIDs=@strSubIDs
+ ISNULL(sub_id,'')
+ ','
FROM [table] WHERE ID
= @ID
RETURN @strSubIDs
END
And Second, you can change your dataset as below,
SELECT ID, dbo.GetSubIDs(ID),TEXT
FROM [table]GROUP
BY ID,text
If you have any questions, please feel free to ask.
Thanks.
Eileen
May 17th, 2011 4:20am