sql server - Is it possible to use XML dataset in SSRS report designer -
is possible use xml dataset in ssrs report designer ? need fetch large dataset like,
master row - details1 - details2 - ... detailsn
i created query returns me xml data using for xml raw
not able use in query designer when adding new report.
please note not using xml data source, trying add xml dataset using select query.. havn't tried stored procedure not sure if work well...
in other words, possible add xml dataset (not datasource) ssrs reports
if need xml looking treeview might this:
declare @xml xml= '<root> <level content="level a"> <detail content="detail aa"> <item content="item aaa" /> </detail> <detail content="detail ab"> <item content="item aba" /> <item content="item abb" /> <item content="item abc" /> </detail> <detail content="detail ac"> <item content="item aca" /> <item content="item acb" /> </detail> </level> <level content="level b"> <detail content="detail ba"> <item content="item baa" /> </detail> <detail content="detail bb"> <item content="item bba" /> <item content="item bbb" /> <item content="item bbc" /> </detail> <detail content="detail bc"> <item content="item bca" /> <item content="item bcb" /> </detail> </level> </root>'; select case the.node.value('fn:local-name(.)','varchar(max)') when 'level' '' when 'detail' replicate(' ',4) when 'item' replicate(' ',8) else '' end + the.node.value('@content','varchar(max)') @xml.nodes('root//*') the(node)
the result
level detail aa item aaa detail ab item aba item abb item abc detail ac item aca item acb level b detail ba item baa detail bb item bba item bbb item bbc detail bc item bca item bcb
Comments
Post a Comment