Aracılığıyla paylaş


ReportingService2010.CreateCacheRefreshPlan Yöntemi

Önbellek yenileme planını oluşturur bir öğe.Bu yöntem uygulandığı raporu ve Dataset öğe türleri.

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

Sözdizimi

'Bildirim
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCacheRefreshPlan", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function CreateCacheRefreshPlan ( _
    ItemPath As String, _
    Description As String, _
    EventType As String, _
    MatchData As String, _
    Parameters As ParameterValue() _
) As String
'Kullanım
Dim instance As ReportingService2010
Dim ItemPath As String
Dim Description As String
Dim EventType As String
Dim MatchData As String
Dim Parameters As ParameterValue()
Dim returnValue As String

returnValue = instance.CreateCacheRefreshPlan(ItemPath, _
    Description, EventType, MatchData, _
    Parameters)
[SoapHeaderAttribute("TrustedUserHeaderValue")]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCacheRefreshPlan", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string CreateCacheRefreshPlan(
    string ItemPath,
    string Description,
    string EventType,
    string MatchData,
    ParameterValue[] Parameters
)
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCacheRefreshPlan", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
String^ CreateCacheRefreshPlan(
    String^ ItemPath, 
    String^ Description, 
    String^ EventType, 
    String^ MatchData, 
    array<ParameterValue^>^ Parameters
)
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateCacheRefreshPlan", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member CreateCacheRefreshPlan : 
        ItemPath:string * 
        Description:string * 
        EventType:string * 
        MatchData:string * 
        Parameters:ParameterValue[] -> string 
public function CreateCacheRefreshPlan(
    ItemPath : String, 
    Description : String, 
    EventType : String, 
    MatchData : String, 
    Parameters : ParameterValue[]
) : String

Parametreler

  • ItemPath
    Tür: System.String
    öğe ile dosya adı da dahil olmak üzere önbelleğini yenileme planı ilişkilendirmek ve SharePoint modunda, uzantının tam url.
  • Description
    Tür: System.String
    Önbellek yenileme planı açıklaması.Bu parametre küme için nullnull başvuru (Visual Basic'te Nothing) (hiçbir şey Visual Basic), rapor sunucusu otomatik olarak bir tanımı oluşturur.
  • EventType
    Tür: System.String
    Önbellek yenileme tetikleyen olay türü.Şu anda geçerli bir değer olan RefreshCache.Bu parametre küme için nullnull başvuru (Visual Basic'te Nothing) (hiçbir şey olan Visual Basic), varsayılan değer olan RefreshCache kullanılır.
  • MatchData
    Tür: System.String
    Belirtilen ile ilişkili verileri EventType parametresi.Bu, bir seri hale getirilmiş olmalıdır ScheduleDefinition belirli öğe ile ItemPath, ya da zamanlama kimliği bir paylaşılan zamanlama.

Dönüş Değeri

Tür: System.String
A dize temsil eden önbelleğini yenileme planı için benzersiz tanımlayıcı.

Açıklamalar

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

soap üstbilgisi kullanımı

(De)TrustedUserHeaderValue

(Giden)ServerInfoHeaderValue

Yerel mod gerekli izinleri

ReadPolicy AND UpdatePolicy

SharePoint modu gerekli izinleri

EditListItems() AND ViewListItems()

EventType Önbellek yenileme planları oluşturmak için kullanılan iş RefreshCache.MatchData Parametresi bağlıdır olay türü.Olay ise, bir TimedSubscription olay, bir ScheduleDefinition nesnesi olarak gerekli MatchData parametresi.Seri hale, ilk getirmek gerekir ScheduleDefinition Nesne bir dize değeri olarak geçirmek ve esas Önbellek yenileme planı oluşturmak için xml olarakzamanlama.

Kullanabileceğiniz XmlSerializer , nesne sınıfı bir xml biçimine dönüştürmek için sınıf dize otomatik olarak.

Örnekler

Aşağıdaki örnek, bir rapor önbelleğine yükler ve önbellek her gün yeniler.

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 report = "http://<Server Name>" +
            "/Docs/Documents/AdventureWorks Sample Reports" +
            "/Sales Order Detail.rdl";
        string desc = "Daily refresh of the report cache, starting 2/22/2010 at 2:15am";
        string eventType = "RefreshCache";
        ScheduleDefinition definition = 
            new ScheduleDefinition();
        // Create the schedule definition.
        definition.StartDateTime =
        new DateTime(2010, 2, 22, 10, 15, 0);
        DailyRecurrence recurrence = 
            new DailyRecurrence();
        recurrence.DaysInterval = 1;
        definition.Item = recurrence;
        // Serialize schedule definition
        System.Xml.Serialization.XmlSerializer serializer = 
            new System.Xml.Serialization.XmlSerializer(
                typeof(ScheduleDefinition));
        MemoryStream stream = new MemoryStream();
        serializer.Serialize(stream, definition);
        UTF8Encoding encoding = new UTF8Encoding();
        string defString = encoding.GetString(stream.ToArray());

        try
        {
            rs.CreateCacheRefreshPlan(report, desc, eventType, 
                defString, null);
        }

        catch (SoapException e)
        {
            Console.WriteLine(e.Detail.InnerXml.ToString());
        }
    }
}
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 ReportingService2010()
        rs.Url = "http://<Server Name>" + _
            "/_vti_bin/ReportServer/ReportService2010.asmx"
        rs.Credentials = _
            System.Net.CredentialCache.DefaultCredentials

        Dim report As String = "http://<Server Name>/Docs/" + _
            "Documents/AdventureWorks Sample Reports/" + _
            "Sales Order Detail.rdl"
        Dim desc As String = " Daily refresh of the report cache, _
            starting 2/22/2010 at 2:15am."

        Dim eventType As String = "RefreshCache"
        Dim definition As New ScheduleDefinition()
        ' Create the schedule definition.
        definition.StartDateTime = New DateTime(2010, 2, 22, 10, 15, 0)
        Dim recurrence As New DailyRecurrence()
        recurrence.DaysInterval = 1
        definition.Item = recurrence
        Dim serializer As New System.Xml.Serialization.XmlSerializer(_
            GetType(ScheduleDefinition))
        Dim stream As New MemoryStream()
        serializer.Serialize(stream, definition)
        Dim encoding As New UTF8Encoding()
        Dim defString As String = encoding.GetString(stream.ToArray())

        Try
            rs.CreateCacheRefreshPlan(report, desc, eventType, 
                defString, Nothing)
        Catch e As SoapException
            Console.WriteLine(e.Detail.InnerXml.ToString())
        End Try

    End Sub

End Class