ReportingService2005.GetReportDefinition Method
Retrieves the report definition for a report.
命名空间: Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005
程序集: ReportService2005 (in reportingservice2005.dll)
语法
声明
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace:="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction:=SoapHeaderDirection.Out)> _
Public Function GetReportDefinition ( _
Report As String _
) As Byte()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)]
public byte[] GetReportDefinition (
string Report
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace=L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse::Literal, ParameterStyle=SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction=SoapHeaderDirection::Out)]
public:
array<unsigned char>^ GetReportDefinition (
String^ Report
)
/** @attribute SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped) */
/** @attribute SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out) */
public byte[] GetReportDefinition (
String Report
)
SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetReportDefinition", RequestNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", ResponseNamespace="https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)
SoapHeaderAttribute("ServerInfoHeaderValue", Direction=SoapHeaderDirection.Out)
public function GetReportDefinition (
Report : String
) : byte[]
参数
- Report
The full path name of the report.
返回值
The report definition as a Base 64-encoded byte array. For more information about this data type, see "Byte Structure" in the Microsoft .NET Framework documentation.
示例
To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see 编译和运行代码示例. The following code example uses the GetReportDefinition method to retrieve the definition of a report and store it as an XML document in the local file system:
Imports System
Imports System.IO
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim reportName As String = "/SampleReports/Company Sales"
Dim reportDefinition As Byte() = Nothing
Dim doc As New System.Xml.XmlDocument
Try
reportDefinition = rs.GetReportDefinition(reportName)
Dim stream As New MemoryStream(reportDefinition)
doc.Load(stream)
doc.Save("C:\Company Sales.rdl")
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
Catch e As IOException
Console.WriteLine(e.Message)
End Try
End Sub 'Main
End Class 'Sample
using System;
using System.IO;
using System.Web.Services.Protocols;
class Sample
{
public static void Main()
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string reportName = "/SampleReports/Company Sales";
byte[] reportDefinition = null;
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
try
{
reportDefinition = rs.GetReportDefinition(reportName);
MemoryStream stream = new MemoryStream(reportDefinition);
doc.Load(stream);
doc.Save(@"C:\Company Sales.rdl");
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
catch (IOException e)
{
Console.WriteLine(e.Message);
}
}
}
线程安全
Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
平台
开发平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
目标平台
有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。
请参阅
参考
ReportingService2005 Class
ReportingService2005 Members
Microsoft.WSSUX.ReportingServicesWebService.RSManagementService2005 Namespace