Aracılığıyla paylaş


ReportExecutionService.Render Yöntemi

Belirli bir rapor işler ve belirtilen biçimde işler.

Ad Alanı:  ReportExecution2005
Derleme:  ReportExecution2005 (ReportExecution2005 içinde.dll)

Sözdizimi

'Bildirim
<SoapHeaderAttribute("ExecutionHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/Render", 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("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
Public Function Render ( _
    Format As String, _
    DeviceInfo As String, _
    <OutAttribute> ByRef Extension As String, _
    <OutAttribute> ByRef MimeType As String, _
    <OutAttribute> ByRef Encoding As String, _
    <OutAttribute> ByRef Warnings As Warning(), _
    <OutAttribute> ByRef StreamIds As String() _
) As Byte()
'Kullanım
Dim instance As ReportExecutionService
Dim Format As String
Dim DeviceInfo As String
Dim Extension As String
Dim MimeType As String
Dim Encoding As String
Dim Warnings As Warning()
Dim StreamIds As String()
Dim returnValue As Byte()

returnValue = instance.Render(Format, _
    DeviceInfo, Extension, MimeType, _
    Encoding, Warnings, StreamIds)
[SoapHeaderAttribute("ExecutionHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/Render", 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("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public byte[] Render(
    string Format,
    string DeviceInfo,
    out string Extension,
    out string MimeType,
    out string Encoding,
    out Warning[] Warnings,
    out string[] StreamIds
)
[SoapHeaderAttribute(L"ExecutionHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/Render", 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"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
public:
array<unsigned char>^ Render(
    String^ Format, 
    String^ DeviceInfo, 
    [OutAttribute] String^% Extension, 
    [OutAttribute] String^% MimeType, 
    [OutAttribute] String^% Encoding, 
    [OutAttribute] array<Warning^>^% Warnings, 
    [OutAttribute] array<String^>^% StreamIds
)
[<SoapHeaderAttribute("ExecutionHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/Render", 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("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
member Render : 
        Format:string * 
        DeviceInfo:string * 
        Extension:string byref * 
        MimeType:string byref * 
        Encoding:string byref * 
        Warnings:Warning[] byref * 
        StreamIds:string[] byref -> byte[] 
public function Render(
    Format : String, 
    DeviceInfo : String, 
    Extension : String, 
    MimeType : String, 
    Encoding : String, 
    Warnings : Warning[], 
    StreamIds : String[]
) : byte[]

Parametreler

  • Format
    Tür: System.String
    Rapor işlemek istediğiniz biçimi.Bu bağımsız değişken için bir işleme uzantısı eşleştirir.xml, null, csv, görüntü, pdf, bazı, html3.2, mhtml, excel ve Word'ün desteklenen uzantılar içerir.Desteklenen uzantılar listesi arama yoluyla elde edilebilir ListRenderingExtensions yöntem.
  • DeviceInfo
    Tür: System.String
    xml dize belirtilen işleme uzantısı için gerekli olan aygıta özgü içerik içeren Format parametresi.DeviceInfo ayarları DeviceInfo xml öğesi iç öğeler olarak geçirilmelidir.Aygıt bilgi ayarlarını belirli bir çıkış biçimleri hakkında daha fazla bilgi için bkz: fe718939-7efe-4c7f-87cb-5f5b09caeff4 aygıt bilgileri ayarları.
  • Extension
    Tür: System.String%
    [Çıkış] Çıkış akışı için karşılık gelen dosya uzantısı.
  • MimeType
    Tür: System.String%
    [Çıkış] MIME türü işlenmiş rapor.
  • Encoding
    Tür: System.String%
    [Çıkış] Rapor sunucusu rapor içeriğini işler yaparken kullanılan kodlama.
  • StreamIds
    Tür: array<System.String[]%
    [Çıkış] Akış tanımlayıcılar.Bu kimlikleri geçirilen RenderStream yöntem.Belirli bir raporu ile ilişkili dış kaynaklar (resim vb.) işlemek için kullanabilirsiniz.
    Görüntü işleme uzantısı kullanılıyorsa, yöntem boş bir dizi olarak verir StreamIds.

Dönüş Değeri

Tür: array<System.Byte[]
A Byte [ raporunda belirtilen biçim dizesi.

Açıklamalar

Aşağıdaki tablo üstbilgi ve izinler bu işlemi gösterir.

soap üstbilgisi kullanımı

(De)TrustedUserHeaderValue

(De)ExecutionHeaderValue

(Giden)ServerInfoHeaderValue

Yerel mod gerekli izinleri

Ana rapor ve tüm alt raporlar: ReadProperties AND ExecuteAndView

SharePoint modu gerekli izinleri

Ana rapor ve tüm alt raporlar: ViewListItems()

Rendertanımlanan rapor yürütme ile ilişkili bir işlem gören rapor işler ExecutionInfo başlığı.Hiçbir geçici anlık işlenen rapor yürütmek durumu varsa, bu yöntem için yürütmek durumu oluşturulan geçici bir anlık görüntü sonuçta (tüm kimlik bilgileri ve parametre gereksinimler karşılanırsa) raporu, yürütülür.-Query parametresi değerleri değiştirdiğiniz raporu çalıştırırsanız, yeni geçici anlık görüntü oluşturulur.Yürütme durumu hakkında daha fazla bilgi için bkz: Tanımlayıcı yürütme durumu.

Yürütme seçenekleri ise küme önbellek veya yürütme anlık çağrısı Render kullanabilir varolan bir anlık görüntü.

Rapor ise küme önbellek ve sağlanan parametre değerleri ile eşleşen kimlik bilgileri, anlık görüntü görüntü yerel olarak önbellekte tutulan rapor işlemek yerine, yüklenmemiş olabilir.

Bu yöntem, kimlik bilgisi ve parametre gereksinimler karşılanırsa, bir hata döndürür.

Sonraki aramalar için Render alıp, işleme uzantısı destekler belirterek raporun ek sayfalar için kullanılabilirbirden çok sayfa.

Render sınırlamalardan yöntem bellekteki dosyanın tamamını olmalıdır çıkış akışı sağlanamayabilir olduğunu, olduğundan.

Lütfen bakın Tanımlayıcı yürütme durumu için bir tartışma yürütme ömrünün, yük ve oluşturma gerekli adımları açıklamasını içerirraporu.

Örnekler

Aşağıdaki kod örneği derlemek için başvuru gerekir Reporting Services wsdl ve belirli ad alanları almakDaha fazla bilgi için, bkz. Compiling and Running Code Examples.Aşağıdaki kod örneği, mhtml olarak bir rapor oluşturur ve disk .mht dosyası olarak kaydeder.

Imports System
Imports System.IO
Imports System.Web.Services.Protocols
Imports myNamespace.MyReferenceName

Class Sample
    Public Shared Sub Main()
        Dim rs As New ReportExecutionService()
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials
        rs.Url = "http://myserver/reportserver/ReportExecution2005.asmx"

        ' Render arguments
        Dim result As Byte() = Nothing
        Dim reportPath As String = "/AdventureWorks Sample Reports/Employee Sales Summary "
        Dim format As String = "MHTML"
        Dim historyID As String = Nothing
        Dim devInfo As String = "<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>"

        ' Prepare report parameter.
        Dim parameters(2) As ParameterValue

        parameters(0) = New ParameterValue()
        parameters(0).Name = "EmpID"
        parameters(0).Value = "288"
        parameters(1) = New ParameterValue()
        parameters(1).Name = "ReportMonth"
        parameters(1).Value = "6" ' June
        parameters(2) = New ParameterValue()
        parameters(2).Name = "ReportYear"
        parameters(2).Value = "2004"

        Dim credentials As DataSourceCredentials() = Nothing
        Dim showHideToggle As String = Nothing
        Dim encoding As String = ""
        Dim mimeType As String = ""
        Dim warnings As Warning() = Nothing
        Dim reportHistoryParameters As ParameterValue() = Nothing
        Dim streamIDs As String() = Nothing

        Dim execInfo As New ExecutionInfo
        Dim execHeader As New ExecutionHeader()
        Dim SessionId As String
        Dim extension As String = ""

        rs.ExecutionHeaderValue = execHeader

        execInfo = rs.LoadReport(reportPath, historyID)

        rs.SetExecutionParameters(parameters, "en-us")

        SessionId = rs.ExecutionHeaderValue.ExecutionID
        Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID)


        Try
            result = rs.Render(format, devInfo, extension, _
               encoding, mimeType, warnings, streamIDs)

            execInfo = rs.GetExecutionInfo()

            Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime)


        Catch e As SoapException
            Console.WriteLine(e.Detail.OuterXml)
        End Try

        ' Write the contents of the report to an MHTML file.
        Try
            Dim stream As FileStream = File.Create("report.mht", result.Length)
            Console.WriteLine("File created.")
            stream.Write(result, 0, result.Length)
            Console.WriteLine("Result written to the file.")
            stream.Close()
        Catch e As Exception
            Console.WriteLine(e.Message)
        End Try
    End Sub 'Main
End Class
using System;
using System.IO;
using System.Web.Services.Protocols;
using myNamespace.MyReferenceName;

class Sample
{
    static void Main(string[] args)
    {
        ReportExecutionService rs = new ReportExecutionService();
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
        rs.Url = "http://myserver/reportserver/ReportExecution2005.asmx";

        // Render arguments
        byte[] result = null;
        string reportPath = "/AdventureWorks Sample Reports/Employee Sales Summary";
        string format = "MHTML";
        string historyID = null;
        string devInfo = @"<DeviceInfo><Toolbar>False</Toolbar></DeviceInfo>";

        // Prepare report parameter.
        ParameterValue[] parameters = new ParameterValue[3];
        parameters[0] = new ParameterValue();
        parameters[0].Name = "EmpID";
        parameters[0].Value = "288";
        parameters[1] = new ParameterValue();
        parameters[1].Name = "ReportMonth";
        parameters[1].Value = "6"; // June
        parameters[2] = new ParameterValue();
        parameters[2].Name = "ReportYear";
        parameters[2].Value = "2004";

        DataSourceCredentials[] credentials = null;
        string showHideToggle = null;
        string encoding;
        string mimeType;
        string extension;
        Warning[] warnings = null;
        ParameterValue[] reportHistoryParameters = null;
        string[] streamIDs = null;
        
        ExecutionInfo execInfo = new ExecutionInfo();
        ExecutionHeader execHeader = new ExecutionHeader();

        rs.ExecutionHeaderValue = execHeader;

        execInfo = rs.LoadReport(reportPath, historyID);

        rs.SetExecutionParameters(parameters, "en-us"); 
        String SessionId = rs.ExecutionHeaderValue.ExecutionID;

        Console.WriteLine("SessionID: {0}", rs.ExecutionHeaderValue.ExecutionID);


        try
        {
            result = rs.Render(format, devInfo, out extension, out encoding, out mimeType, out warnings, out streamIDs);

            execInfo = rs.GetExecutionInfo();

            Console.WriteLine("Execution date and time: {0}", execInfo.ExecutionDateTime);


        }
        catch (SoapException e)
        {
            Console.WriteLine(e.Detail.OuterXml);
        }
        // Write the contents of the report to an MHTML file.
        try
        {
            FileStream stream = File.Create("report.mht", result.Length);
            Console.WriteLine("File created.");
            stream.Write(result, 0, result.Length);
            Console.WriteLine("Result written to the file.");
            stream.Close();
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
        }

    }
}