Linguaggio

ReportingService2005.CreateLinkedReport Metodo

Definizione

Aggiunge un nuovo report collegato al database del server di report.

public:
 void CreateLinkedReport(System::String ^ Report, System::String ^ Parent, System::String ^ Link, cli::array <ReportService2005::Property ^> ^ Properties);
public void CreateLinkedReport(string Report, string Parent, string Link, ReportService2005.Property[] Properties);
member this.CreateLinkedReport : string * string * string * ReportService2005.Property[] -> unit
Public Sub CreateLinkedReport (Report As String, Parent As String, Link As String, Properties As Property())

Parametri

Report
String

Il nome del nuovo rapporto collegato.

Parent
String

L'URL completamente qualificato della cartella genitore a cui aggiungere il nuovo report.

Link
String

L'URL completamente qualificato del report che sarà utilizzato per la definizione del report.

Properties
Property[]

Un array di Property oggetti che definisce i nomi delle proprietà e i valori da impostare per il report collegato.

Esempio

Per compilare questo esempio di codice, devi fare riferimento al WSDL di Reporting Services e importare determinati namespace. Per maggiori informazioni, vedi Compiling and Conducting Code Examples. Il seguente esempio di codice crea un report collegato:

Imports System  
Imports System.Web.Services.Protocols  

Class Sample  
   Public Shared Sub Main()  
      Dim rs As New ReportingService2005()  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials  

      Dim prop As New [Property]()  
      prop.Name = "Description"  
      prop.Value = "A new linked report"  
      Dim props(0) As [Property]  
      props(0) = prop  

      Try  
         rs.CreateLinkedReport("Employee Sales Report2", "/SampleReports", "/SampleReports/Employee Sales Summary", props)  

      Catch e As SoapException  
         Console.WriteLine(e.Detail.InnerXml.ToString())  
      End Try  
   End Sub 'Main  
End Class 'Sample  
using System;  
using System.Web.Services.Protocols;  

class Sample  
{  
   public static void Main()  
   {  
      ReportingService2005 rs = new ReportingService2005();  
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;  

      Property prop = new Property();  
      prop.Name = "Description";  
      prop.Value = "A new linked report";  
      Property[] props = new Property[1];  
      props[0] = prop;  

      try  
      {  
         rs.CreateLinkedReport("Employee Sales Report2", "/SampleReports",  
            "/SampleReports/Employee Sales Summary", props);  
      }  

      catch (SoapException e)  
      {  
         Console.WriteLine(e.Detail.InnerXml.ToString());   
      }  
   }  
}  

Commenti

La tabella sottostante mostra informazioni sull'intestazione e sui permessi di questa operazione.

Intestazioni SOAP (Dentro) BatchHeaderValue

(Fuori) ServerInfoHeaderValue
Autorizzazioni necessarie CreateReport on Parent E ReadProperties ON Report

La lunghezza dei parametri e Link non può superare i 260 caratteri; altrimenti, viene lanciata un'eccezione SOAP con il codice di errore rsItemLengthExceeded.Parent

I Parent parametri e Link non possono essere nulli o vuoti né contenere i seguenti caratteri riservati: : ? ; @ & = + $ , \ * > < | . ". Puoi usare il carattere a barra avanzata (/) per separare gli elementi nel nome completo del percorso della cartella, ma non puoi usarlo alla fine del nome della cartella.

Un report collegato ha le stesse proprietà di un report standard, ma non contiene una propria definizione di report. Un rapporto collegato non può fare riferimento a un altro rapporto collegato.

Il creatore di un report collegato deve avere il permesso di leggere la definizione del report a cui il report collegato fa riferimento; tuttavia, questo livello di permesso non è richiesto per eseguire un report collegato.

Usando il CreateLinkedReport metodo si modificano le ModifiedBy proprietà e ModifiedDate della cartella genitore.

Si applica a