Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Display all column values , one per line in a textbox in the SSRS report


Display all column values , one per line in a textbox in the SSRS report

Author
Message
VSSGeorge
VSSGeorge
Say Hey Kid
Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)

Group: General Forum Members
Points: 681 Visits: 1401
Hi
I have a scenario like this:
For a particular audit code, there will be more than one audit description.
I have to show the non-duplicate audit description values in my SSRS report without comma sepaeration
I.e. in case of several entries, list all, one per line in a textbox in the report.
How to achieve this?

Sample Data:


select 'Draft' as auditedAreaDescription, 'A23' as auditId
union select 'Activity1' as auditedAreaDescription, 'A24' as auditId
union select 'Activity2' as auditedAreaDescription, 'A24' as auditId
union select 'Demo' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity ' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86932' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86933' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86934' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity_26' as auditedAreaDescription, 'A26' as auditId


higgim
higgim
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1035 Visits: 2614
Is the attached the kind of thing your looking for?
Attachments
Untitled.jpg (15 views, 24.00 KB)
VSSGeorge
VSSGeorge
Say Hey Kid
Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)

Group: General Forum Members
Points: 681 Visits: 1401
Yes michael.higgins, That is the one I am looking for.

But one small thing, I don't need the separation line between the audit descriptions for a particular audit.

i.e. for audit Id, A24, the audit descriptions Activity1 and Activity2 should be in a single text box without the separation line in between them.
twin.devil
twin.devil
Ten Centuries
Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)Ten Centuries (1.4K reputation)

Group: General Forum Members
Points: 1374 Visits: 2595


WITH C
AS (
select 'Draft' as auditedAreaDescription, 'A23' as auditId
union select 'Activity1' as auditedAreaDescription, 'A24' as auditId
union select 'Activity2' as auditedAreaDescription, 'A24' as auditId
union select 'Demo' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity ' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86932' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86933' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity 86934' as auditedAreaDescription, 'A25' as auditId
union select 'New Activity_26' as auditedAreaDescription, 'A26' as auditId
)

SELECT auditid,

(
select auditedAreaDescription + ' '
from c cc
where c.auditid = cc.auditid
for XML path ('')
) as auditedAreaDescription

from c



Hope this helps
higgim
higgim
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1035 Visits: 2614
You just need to put a tablix on the report pointing to your data set, create a group on the ID and then another child group with the audit description. From there to remove the borders is just a formatting thing.
VSSGeorge
VSSGeorge
Say Hey Kid
Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)Say Hey Kid (681 reputation)

Group: General Forum Members
Points: 681 Visits: 1401
I achieved the answer using this way:


SELECT
   isnull((
   select stuff((select ','+ convert(varchar(1000),auditedAreaDescription) from Local_AuditedAreas LA
   inner join Local_Audits LU ON LU.auditIncId = LA.auditIncId and LU.auditSqlId = LA.auditSqlId AND LU.isDeleted = 0x0 AND LA.isDeleted = 0x0
   for xml path('')) , 1,1,'')
   Wink,' ') as auditedAreaDescription



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search