Get a Report Handle Using SSRS2008 and PowerShell V3

In order to work with report items with SQL Server Reporting Services 2008, most of the time you need to get a handle to the report items.

Here is a sample code snippet that uses the ReportingService2010 web service and PowerShell V3 CTP.

cls

#replace this with your reportserver web service URI
$ReportServerUri  = "http://localhost/ReportServer/ReportService2010.asmx";

$proxy = New-WebServiceProxy -Uri $ReportServerUri -UseDefaultCredential ;

#we'll use the ListChildren method to navigate through all your SSRS items
#the $true parameter specifies recursive navigation
$catalogitemsarray = $proxy.ListChildren("/", $true);

$reportpath = "/Customers/Customer Contact Numbers";
$report = $null;

foreach ($catalogitem in $catalogitemsarray)
{
   if($catalogitem.Path -eq $reportpath )
      {
         $report = $catalogitem;
      }
}

#display properties
$report

Sample result is as follows:

ID                    : 15b3dd87-d0de-43a0-8692-030dcfdab945
Name                  : Customer Contact Numbers
Path                  : /Customers/Customer Contact Numbers
VirtualPath           : 
TypeName              : Report
Size                  : 23870
SizeSpecified         : True
Description           : 
Hidden                : False
HiddenSpecified       : False
CreationDate          : 5/13/2012 12:13:48 AM
CreationDateSpecified : True
ModifiedDate          : 5/13/2012 12:13:48 AM
ModifiedDateSpecified : True
CreatedBy             : KERRIGANAdministrator
ModifiedBy            : KERRIGANAdministrator
ItemMetadata          : {}

2 thoughts on “Get a Report Handle Using SSRS2008 and PowerShell V3

  1. kiquenet June 27, 2012 / 6:08 am

    Great, how can I do Get a Report Handle Using SSRS2008 and PowerShell V2 ?

    and Render Report Using SSRS2008 and PowerShell V2 ?

    thx

    Like

Leave a reply to kiquenet Cancel reply