ReportingService2006.GetReportDefinition Method
Retrieves the report definition for a report.
Spazio dei nomi: ReportService2006
Assembly : ReportService2006 (in reportservice2006.dll)
Sintassi
'Dichiarazione
Public Function GetReportDefinition ( _
Report As String _
) As Byte()
public byte[] GetReportDefinition (
string Report
)
public:
array<unsigned char>^ GetReportDefinition (
String^ Report
)
public byte[] GetReportDefinition (
String Report
)
public function GetReportDefinition (
Report : String
) : byte[]
Parametri
- Report
The fully qualified URL of the report including the file name and .rdl file name extension.
Valore restituito
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.
Esempio
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)
{
ReportingService2006 rs = new ReportingService2006();
rs.Url = "http://<Server Name>" +
"/_vti_bin/ReportServer/ReportService2006.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.GetReportDefinition(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);
}
}
}
Imports System
Imports System.IO
Imports System.Text
Imports System.Web.Services
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2006()
rs.Url = "http://<Server Name>" + _
"/_vti_bin/ReportServer/ReportService2006.asmx"
rs.Credentials = _
System.Net.CredentialCache.DefaultCredentials
Dim reportName As String = "http://<Server Name>" + _
"/Docs/Documents/AdventureWorks Sample Reports" + _
"/Sales Order Detail.rdl"
Dim reportDefinition As Byte() = Nothing
Dim doc As New System.Xml.XmlDocument
Try
reportDefinition = rs.GetReportDefinition(reportName)
Dim stream As New MemoryStream(reportDefinition)
Dim myDocumentsFolder As String = _
My.Computer.FileSystem.SpecialDirectories.MyDocuments
doc.Load(stream)
doc.Save(Path.Combine(myDocumentsFolder, _
"Sales Order Detail.rdl"))
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml.ToString())
Catch e As IOException
Console.WriteLine(e.Message)
End Try
End Sub
End Class
Thread Safety
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.
Piattaforme
Piattaforme di sviluppo
Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.
Piattaforme di destinazione
Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Server 2008, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2), Windows 2000 Professional, Windows 2000 Advanced Server, Windows XP Home Edition, Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005., Windows Vista, Windows Mobile 5.0, Windows Mobile 2003 for Pocket PC, Windows CE 5.0
Vedere anche
Riferimento
ReportingService2006 Class
ReportingService2006 Members
ReportService2006 Namespace