Aracılığıyla paylaş


ReportingService2005.CreateReport Yöntemi

Yeni bir rapor ekler rapor sunucusu veritabanı.

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

Sözdizimi

'Bildirim
<SoapHeaderAttribute("BatchHeaderValue")> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateReport", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
Public Function CreateReport ( _
    Report As String, _
    Parent As String, _
    Overwrite As Boolean, _
    Definition As Byte(), _
    Properties As Property() _
) As Warning()
'Kullanım
Dim instance As ReportingService2005
Dim Report As String
Dim Parent As String
Dim Overwrite As Boolean
Dim Definition As Byte()
Dim Properties As Property()
Dim returnValue As Warning()

returnValue = instance.CreateReport(Report, _
    Parent, Overwrite, Definition, Properties)
[SoapHeaderAttribute("BatchHeaderValue")]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateReport", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public Warning[] CreateReport(
    string Report,
    string Parent,
    bool Overwrite,
    byte[] Definition,
    Property[] Properties
)
[SoapHeaderAttribute(L"BatchHeaderValue")]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateReport", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
public:
array<Warning^>^ CreateReport(
    String^ Report, 
    String^ Parent, 
    bool Overwrite, 
    array<unsigned char>^ Definition, 
    array<Property^>^ Properties
)
[<SoapHeaderAttribute("BatchHeaderValue")>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/CreateReport", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
member CreateReport : 
        Report:string * 
        Parent:string * 
        Overwrite:bool * 
        Definition:byte[] * 
        Properties:Property[] -> Warning[] 
public function CreateReport(
    Report : String, 
    Parent : String, 
    Overwrite : boolean, 
    Definition : byte[], 
    Properties : Property[]
) : Warning[]

Parametreler

  • Parent
    Tür: System.String
    Rapor eklemek üst klasöre tam URL'si.
  • Overwrite
    Tür: System.Boolean
    A Boole belirtilen konumda aynı adla varolan bir raporu yazılmayacağını olup olmadığını gösteren ifade.

Dönüş Değeri

Tür: array<ReportService2005.Warning[]
Bir dizi Warning Rapor tanımı doğrulandı sırasında oluştu uyarılar açıklayan nesnelerinin.

Açıklamalar

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

soap üstbilgileri

(De)BatchHeaderValue

(Giden)ServerInfoHeaderValue

Gerekli izinler

Yeni bir rapor oluşturma: CreateReportüzerinde Parent ve ReadProperties rapor veri kaynakları üzerinde ve ReadProperties rapor datasets üzerinde

Varolan bir raporu güncelleştiriliyor: UpdateReportDefinitionüzerinde Report ve UpdateProperties , Report (, Properties özelliklerini içerir) ve UpdateProperties rapor veri kaynakları üzerinde ve UpdateProperties rapor datasets üzerinde

Uzunluğu Parent parametresi; 260 karakteri aşamaz Aksi takdirde hata koduyla bir soap özel durum rsItemLengthExceeded.

Parent Parametresi null veya boş veya aşağıdaki ayrılmış karakterleri içeremez: : ? ; @ & = + $ , \ * > < | . ".Öğeler klasörünün tam yol adını ayırmak için eğik çizgi (/) karakter kullanabilirsiniz, ancak klasör adının sonuna kullanamazsınız.

Hatalar oluşursa, rapor oluşturulmaz.

Bir rapora ekleme rapor sunucusu veritabanı değiştirir ModifiedBy ve ModifiedDate özelliklerinin üst klasör.

Örnekler

Bu kod örneği derlemek için Raporlama Hizmetleri wsdl başvuran ve belirli ad alanları almak gerekir.Daha fazla bilgi için, bkz. Compiling and Running Code Examples.Aşağıdaki kod örneği biçiminde bir rapor yayımlayan bir Rapor Tanımlama Dili rapor sunucusu veritabanı dosyasına (rdl).

Imports System
Imports System.IO
Imports System.Web.Services.Protocols

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

      Dim definition As [Byte]() = Nothing
      Dim warnings As Warning() = Nothing
      Dim name As String = "MyReport"

      Try
         Dim stream As FileStream = File.OpenRead("MyReport.rdl")
         definition = New [Byte](stream.Length - 1) {}
         stream.Read(definition, 0, CInt(stream.Length - 1))
         stream.Close()

      Catch e As IOException
         Console.WriteLine(e.Message)
      End Try

      Try
         warnings = rs.CreateReport(name, "/Samples", False, definition, Nothing)

         If Not (warnings Is Nothing) Then
            Dim warning As Warning
            For Each warning In  warnings
               Console.WriteLine(warning.Message)
            Next warning

         Else
            Console.WriteLine("Report: {0} created successfully with no warnings", name)
         End If

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

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

      Byte[] definition = null;
      Warning[] warnings = null;
      string name = "MyReport";

      try
      {
         FileStream stream = File.OpenRead("MyReport.rdl");
         definition = new Byte[stream.Length];
         stream.Read(definition, 0, (int) stream.Length);
         stream.Close();
      }

      catch(IOException e)
      {
         Console.WriteLine(e.Message);
      }

      try
      {
         warnings = rs.CreateReport(name, "/Samples", false, definition, null);

         if (warnings != null)
         {
            foreach (Warning warning in warnings)
            {
               Console.WriteLine(warning.Message);
            }
         }

         else
            Console.WriteLine("Report: {0} created successfully with no warnings", name);
      }

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

   }
}