ReportingService2005.CreateReport 메서드

정의

보고서 서버 데이터베이스에 새 보고서를 추가합니다.

public:
 cli::array <ReportService2005::Warning ^> ^ CreateReport(System::String ^ Report, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Definition, cli::array <ReportService2005::Property ^> ^ Properties);
public ReportService2005.Warning[] CreateReport (string Report, string Parent, bool Overwrite, byte[] Definition, ReportService2005.Property[] Properties);
member this.CreateReport : string * string * bool * byte[] * ReportService2005.Property[] -> ReportService2005.Warning[]
Public Function CreateReport (Report As String, Parent As String, Overwrite As Boolean, Definition As Byte(), Properties As Property()) As Warning()

매개 변수

Report
String

새 보고서의 이름입니다.

Parent
String

보고서를 추가할 부모 폴더의 정규화된 URL입니다.

Overwrite
Boolean

지정한 위치에서 이름이 동일한 기존 보고서를 덮어쓸지 여부를 나타내는 Boolean 식입니다.

Definition
Byte[]

보고서 서버에 게시할 보고서 정의, 즉 .rdl 파일의 내용입니다. XML 데이터는 보고서 정의 언어 로 http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition/ 정의됩니다.

Properties
Property[]

보고서에 대해 설정할 속성 이름과 값을 포함하는 Property 개체의 배열입니다.

반환

보고서 정의의 유효성을 검사할 때 발생한 모든 경고를 설명하는 Warning 개체의 배열입니다.

예제

이 코드 예제를 컴파일하려면 Reporting Services WSDL을 참조하고 특정 네임스페이스를 가져와야 합니다. 자세한 내용은 코드 예제 컴파일 및 실행을 참조하세요. 다음 코드 예제에서는 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());  
      }  

   }  
}  

설명

다음 표에서는 이 작업에 대한 헤더 및 사용 권한 정보를 보여 줍니다.

SOAP 헤더 (In) BatchHeaderValue

(Out) ServerInfoHeaderValue
필요한 권한 새 보고서 만들기: CreateReportParent 보고서의 데이터 원본 및 보고서의 데이터 세트에 대한 AND ReadPropertiesReadProperties

기존 보고서 업데이트: UpdateReportDefinition AND UpdatePropertiesReportReport 기(속성이 포함된 경우Properties) 및 UpdateProperties 보고서의 데이터 원본 및 UpdateProperties 보고서의 데이터 세트에 대한

매개 변수의 Parent 길이는 260자를 초과할 수 없습니다. 그렇지 않으면 오류 코드 rsItemLengthExceeded와 함께 SOAP 예외가 throw됩니다.

매개 변수는 Parent null이거나 비어 있거나 예약된 문자를 : ? ; @ & = + $ , \ * > < | . "포함할 수 없습니다. 슬래시 문자(/)를 사용하여 폴더의 전체 경로 이름에 있는 항목을 구분할 수 있지만 폴더 이름 끝에 사용할 수는 없습니다.

오류가 발생하면 보고서가 만들어지지 않습니다.

보고서 서버 데이터베이스에 보고서를 추가하면 부모 폴더의 및 ModifiedDate 속성이 수정됩니다ModifiedBy.

적용 대상