ReportingService2010.CreateLinkedItem Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Ajoute un nouvel élément lié à la base de données du serveur de rapports.
public:
void CreateLinkedItem(System::String ^ ItemPath, System::String ^ Parent, System::String ^ Link, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateLinkedItem", 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 CreateLinkedItem(string ItemPath, string Parent, string Link, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateLinkedItem", 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.CreateLinkedItem : string * string * string * ReportService2010.Property[] -> unit
Public Sub CreateLinkedItem (ItemPath As String, Parent As String, Link As String, Properties As Property())
Paramètres
- ItemPath
- String
Le nom du fichier du nouvel élément lié, y compris le nom du fichier.
- Parent
- String
L’URL entièrement qualifiée du dossier parent auquel ajouter le nouvel élément.
- Link
- String
L’URL entièrement qualifiée de l’élément qui sera utilisé pour la définition de l’élément.
- Properties
- Property[]
Un tableau d’objets Property qui définit les noms de propriétés et les valeurs à définir pour l’élément lié.
- Attributs
Exemples
Pour compiler cet exemple de code, vous devez référencer le WSDL de Reporting Services et importer certains espaces de noms. Pour plus d’informations, voir Exemples de compilation et exécution de code. L’exemple de code suivant crée un rapport lié :
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2010()
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.CreateLinkedItem("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()
{
ReportingService2010 rs = new ReportingService2010();
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.CreateLinkedItem("Employee Sales Report2", "/SampleReports",
"/SampleReports/Employee Sales Summary", props);
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.InnerXml.ToString());
}
}
}
Remarques
Le tableau ci-dessous présente les informations sur l’en-tête et les autorisations concernant cette opération.
| Utilisation de l’en-tête SOAP | (En) TrustedUserHeaderValue (Dehors) ServerInfoHeaderValue |
| Mode natif : autorisations requises |
CreateReport sur Parent ET ReadProperties AINSI de suite ItemPath |
| Permissions requises en mode SharePoint | Non pris en charge |
La longueur des Parent paramètres et Link ne peut pas dépasser 260 caractères ; sinon, une exception SOAP est lancée avec le code d’erreur rsItemLengthExceeded.
Les Parent paramètres et Link ne peuvent pas être nuls, vides, ni contenir les caractères réservés suivants : : ? ; @ & = + $ , \ * > < | . ". Vous pouvez utiliser le caractère de barre oblique avant (/) pour séparer les éléments dans le nom complet du chemin, mais vous ne pouvez pas l’utiliser à la fin du nom du dossier
Un article lié possède les mêmes propriétés qu’un article de catalogue standard, mais il ne contient pas sa propre définition d’article. Un élément lié ne peut pas référencer un autre élément lié.
Le créateur d’un élément lié doit avoir la permission de lire la définition de l’élément auquel l’élément lié fait référence ; cependant, ce niveau d’autorisation n’est pas requis pour exécuter un élément lié.
L’utilisation de la CreateLinkedItem méthode modifie les ModifiedBy propriétés et ModifiedDate du dossier parent.