ReportingService2010.GetItemDefinition Method
SQL Server 2008 R2
Retrieves the definition or content for an item. This method applies to the Report, Model, Dataset, Component, Resource, and DataSource item types.
Assembly: ReportService2010 (in ReportService2010.dll)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetItemDefinition", RequestNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace = "http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)] [SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)] [SoapHeaderAttribute("TrustedUserHeaderValue")] public byte[] GetItemDefinition( string ItemPath )
Parameters
- ItemPath
- Type: System.String
The fully qualified URL of the item including the file name and, in SharePoint mode, the extension.
Return Value
Type: System.Byte[]The item definition as a Base 64-encoded byte array. For more information about this data type, see "Byte Structure" in the Microsoft .NET Framework documentation.
The table below shows header and permissions information on this operation.
SOAP Header Usage | (Out) ServerInfoHeaderValue |
Native Mode Required Permissions | Depends on the item type:
|
SharePoint Mode Required Permissions | OpenItems() |
using System; using System.Collections.Generic; using System.IO; using System.Text; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; class Sample { static void Main(string[] args) { ReportingService2010 rs = new ReportingService2010(); rs.Url = "http://<Server Name>" + "/_vti_bin/ReportServer/ReportService2010.asmx"; rs.Credentials = System.Net.CredentialCache.DefaultCredentials; string reportName = "http://<Server Name>/Docs/Documents" + "/AdventureWorks Sample Reports/Sales Order Detail.rdl"; byte[] reportDefinition = null; System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); try { reportDefinition = rs.GetItemDefinition(reportName); MemoryStream stream = new MemoryStream(reportDefinition); string myDocumentsFolder = Environment.GetFolderPath( Environment.SpecialFolder.Personal); doc.Load(stream); doc.Save(Path.Combine(myDocumentsFolder, "Sales Order Detail.rdl")); } catch (SoapException e) { Console.WriteLine(e.Detail.InnerXml.ToString()); } catch (IOException e) { Console.WriteLine(e.Message); } } }
