Hi,
Can some one point me to the right direction of finding a script which generates a report which includes all reporting services reports and the permissions they use along with their location on the server.
Thanks in advance, S
Hi,
Can some one point me to the right direction of finding a script which generates a report which includes all reporting services reports and the permissions they use along with their location on the server.
Thanks in advance, S
Report data is stored in the table named dbo.Catalog. Astonishingly, the Contents column which stores the RDL information has image data type (the very data type which Microsoft strongly encourages us to avoid). The workaround is to cast contents as XML friendly varbinary(max) which can then be cast to xml data type. Here is the script which will list all reports and their respective parameters, so if you run it you will get multiple records per report if the latter has multiple parameters:
select
[name] ReportName, [path] ReportPath,
item.value('@Name', 'varchar(100)') as ParameterName,
item.value('DataType[1]', 'varchar(100)') as DataType,
isnull(item.value('AllowBlank[1]', 'varchar(5)'), 'false') as AllowBlank,
isnull(item.value('Prompt[1]', 'varchar(100)'), '') as Prompt,
isnull(item.value('Hidden[1]', 'varchar(100)'), 'false') as Hidden,
item.value('data(DefaultValue/Values/Value)[1]', 'varchar(100)') as ParameterValue
from
(
select
[Path], [Name], cast(cast([Content] as varbinary(max)) as xml) as ReportXml
from dbo.Catalog
where [Content] is not null and [Type] = 2
) Reports
cross apply ReportXml.nodes('/Report/ReportParameters/ReportParameter') items(item)
order by 1;
All tables in the ReportServer database are very straightforward, i.e. dbo.ReportSchedule relates to dbo.Schedule and dbo.Catalog via ScheduleID - > ScheduleID and ReportID -> ItemID respectively.
Oleg
No one has followed this question yet.