ReportingService2010.SetExecutionOptions 方法

定义

为指定的项设置执行选项和相关的执行属性。 此方法适用于Report项类型。

public:
 void SetExecutionOptions(System::String ^ ItemPath, System::String ^ ExecutionSetting, ReportService2010::ScheduleDefinitionOrReference ^ Item);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetExecutionOptions", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)]
[System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")]
[System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)]
public void SetExecutionOptions (string ItemPath, string ExecutionSetting, ReportService2010.ScheduleDefinitionOrReference Item);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/SetExecutionOptions", ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped, RequestNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", ResponseNamespace="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", Use=System.Web.Services.Description.SoapBindingUse.Literal)>]
[<System.Web.Services.Protocols.SoapHeader("TrustedUserHeaderValue")>]
[<System.Web.Services.Protocols.SoapHeader("ServerInfoHeaderValue", Direction=System.Web.Services.Protocols.SoapHeaderDirection.Out)>]
member this.SetExecutionOptions : string * string * ReportService2010.ScheduleDefinitionOrReference -> unit
Public Sub SetExecutionOptions (ItemPath As String, ExecutionSetting As String, Item As ScheduleDefinitionOrReference)

参数

ItemPath
String

项的完全限定 URL,其中包括文件名(在 SharePoint 模式下,还有扩展名)。

ExecutionSetting
String

一个说明项执行时间的字符串。 值可以是 LiveSnapshot

Item
ScheduleDefinitionOrReference

计划定义或共享计划(ScheduleDefinitionOrReference 对象),报表服务器用其来执行计划中的项。

属性

示例

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;  

        ScheduleDefinition definition = new ScheduleDefinition();  

        // Create the schedule definition.  
        definition.StartDateTime =   
            new DateTime(2010, 2, 22, 10, 15, 0);  
        MinuteRecurrence recurrence = new MinuteRecurrence();  
        recurrence.MinutesInterval = 60;  
        definition.Item = recurrence;  

        // Apply execution settings  
        try  
        {  
            rs.SetExecutionOptions("http://<Server Name>" +  
                "/Docs/Documents/AdventureWorks Sample Reports/" +  
                "Sales Order Detail.rdl",   
                "Snapshot", definition);  
        }  

        catch (SoapException ex)  
        {  
            Console.WriteLine(ex.Detail.OuterXml);  
        }  
    }  
}  
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 definition As New ScheduleDefinition()  
        definition.StartDateTime = _  
            New DateTime(2003, 2, 22, 10, 15, 0)  
        Dim recurrence As New MinuteRecurrence()  
        recurrence.MinutesInterval = 60  
        definition.Item = recurrence  

        Try  
            rs.SetExecutionOptions("http://<Server Name>" + _  
                "/Docs/Documents/AdventureWorks Sample Reports/" + _  
                "Sales Order Detail.rdl", _  
                "Snapshot", definition)  
        Catch ex As SoapException  
            Console.WriteLine(ex.Detail.OuterXml)  
        End Try  

    End Sub  

End Class  

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头用法 (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
本机模式所需的权限 UpdatePolicy
SharePoint 模式所需权限 <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems>

Item仅当 参数的值为 时, ExecutionSetting 参数Snapshot才有效。 如果 ExecutionSetting 设置为 null ,请在 Visual Basic) 中将 的值Item设置为 Live (Nothing。 如果使用共享计划,请将 的值 Item 设置为 ScheduleReference 引用现有共享计划的对象。 如果要定义唯一计划,请将 的值 Item 设置为 ScheduleDefinition 定义唯一计划的对象。 如果项的执行选项基于共享计划,并且该共享计划被删除,则计划与单个项相关联。

如果将 的值 ExecutionSettingLive 更改为 Snapshot,则会从缓存中删除该项。

适用于