ReportingService2010.CreateFolder(String, String, Property[]) Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Aggiunge una cartella al database del server di report o alla raccolta di SharePoint.
public:
ReportService2010::CatalogItem ^ CreateFolder(System::String ^ Folder, System::String ^ Parent, cli::array <ReportService2010::Property ^> ^ Properties);
[System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", 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 ReportService2010.CatalogItem CreateFolder(string Folder, string Parent, ReportService2010.Property[] Properties);
[<System.Web.Services.Protocols.SoapDocumentMethod("http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateFolder", 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.CreateFolder : string * string * ReportService2010.Property[] -> ReportService2010.CatalogItem
Public Function CreateFolder (Folder As String, Parent As String, Properties As Property()) As CatalogItem
Parametri
- Folder
- String
Il nome della nuova cartella.
- Parent
- String
Il nome completo del percorso della cartella genitore a cui aggiungere la nuova cartella.
- Properties
- Property[]
Un array di Property oggetti che definisce i nomi delle proprietà e i valori da impostare per la cartella.
Valori restituiti
La cartella creata.
- Attributi
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 utilizza il CreateFolder metodo per creare una cartella nel database del server di rapporti:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2010()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
' Create a custom property for the folder.
Dim newProp As New [Property]()
newProp.Name = "Department"
newProp.Value = "Finance"
Dim props(0) As [Property]
props(0) = newProp
Dim folderName As String = "Budget"
Try
rs.CreateFolder(folderName, "/", props)
Console.WriteLine("Folder created: {0}", folderName)
Catch e As SoapException
Console.WriteLine(e.Detail.InnerXml)
End Try
End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;
class Sample
{
public static void Main()
{
ReportingService rs = new ReportingService2010();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Create a custom property for the folder.
Property newProp = new Property();
newProp.Name = "Department";
newProp.Value = "Finance";
Property[] props = new Property[1];
props[0] = newProp;
string folderName = "Budget";
try
{
rs.CreateFolder(folderName, "/", props);
Console.WriteLine("Folder created: {0}", folderName);
}
catch(SoapException e)
{
Console.WriteLine(e.Detail.InnerXml);
}
}
}
Commenti
La tabella sottostante mostra informazioni sull'intestazione e sui permessi di questa operazione.
| Utilizzo dell'intestazione SOAP | (Dentro) TrustedUserHeaderValue (Fuori) ServerInfoHeaderValue |
| Permessi richiesti per la modalità nativa | CreateFolder |
| Permessi richiesti in modalità SharePoint | <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems> |
La lunghezza del nome completo del percorso per la nuova cartella non può superare i 260 caratteri; altrimenti, viene lanciata un'eccezione SOAP con il codice rsItemLengthExceededdi errore .
I nomi delle cartelle devono essere meno di 128 caratteri. I nomi non possono essere nulli, consistere in stringhe vuote o 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.
Se My Reports è abilitato, viene lanciata un'eccezione SOAP con il codice rsItemAlreadyExists di errore se si tenta di creare una cartella chiamata "My Reports" nella cartella radice del database del server di report.
Aggiungere una cartella al database del server report modifica le ModifiedBy proprietà e ModifiedDate della cartella genitore.