ReportingService2006.CreateReport 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
SharePoint 라이브러리에 새 보고서를 추가합니다.
public:
ReportService2006::CatalogItem ^ CreateReport(System::String ^ Report, System::String ^ Parent, bool Overwrite, cli::array <System::Byte> ^ Definition, cli::array <ReportService2006::Property ^> ^ Properties, [Runtime::InteropServices::Out] cli::array <ReportService2006::Warning ^> ^ % Warnings);
public ReportService2006.CatalogItem CreateReport(string Report, string Parent, bool Overwrite, byte[] Definition, ReportService2006.Property[] Properties, out ReportService2006.Warning[] Warnings);
member this.CreateReport : string * string * bool * byte[] * ReportService2006.Property[] * Warning[] -> ReportService2006.CatalogItem
Public Function CreateReport (Report As String, Parent As String, Overwrite As Boolean, Definition As Byte(), Properties As Property(), ByRef Warnings As Warning()) As CatalogItem
매개 변수
- Report
- String
파일 이름과 .rdl 파일 이름 확장명을 포함하는 새 보고서의 이름입니다.
- Parent
- String
보고서가 포함될 부모 폴더의 정규화된 URL입니다.
- Overwrite
- Boolean
지정한 위치에서 이름이 동일한 기존 보고서를 덮어쓸지 여부를 나타내는 Boolean
식입니다.
- Definition
- Byte[]
보고서 서버에 게시할 보고서 정의, 즉 .rdl 파일의 내용입니다. XML 데이터는 보고서 정의 언어 로 http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition/ 정의됩니다.
반환
새로 만든 보고서에 대한 CatalogItem 개체입니다.
예제
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
class Sample
{
static void Main(string[] args)
{
ReportingService2006 rs = new ReportingService2006();
rs.Url = "http://<Server Name>" +
"/_vti_bin/ReportServer/ReportService2006.asmx";
rs.Credentials =
System.Net.CredentialCache.DefaultCredentials;
Byte[] definition = null;
Warning[] warnings = null;
string name = "MyReport.rdl";
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
{
string parent = "http://<Server Name>/Docs/Documents/";
CatalogItem report = rs.CreateReport(name, parent,
false, definition, null, out warnings);
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());
}
}
}
Imports System
Imports System.IO
Imports System.Text
Imports System.Web.Services
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2006()
rs.Url = "http://<Server Name>" + _
"/_vti_bin/ReportServer/ReportService2006.asmx"
rs.Credentials = _
System.Net.CredentialCache.DefaultCredentials
Dim definition As [Byte]() = Nothing
Dim warnings As Warning() = Nothing
Dim name As String = "MyReport.rdl"
Try
Dim stream As FileStream = File.OpenRead("MyReport.rdl")
definition = New [Byte](stream.Length - 1) {}
stream.Read(definition, 0, CInt(stream.Length))
stream.Close()
Catch e As IOException
Console.WriteLine(e.Message)
End Try
Try
Dim parentPath As String = _
"http://<Server Name>/Docs/Documents/"
rs.CreateReport(name, parentPath, False, _
definition, Nothing, warnings)
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
End Class
설명
다음 표에서는 이 작업에 대한 헤더 및 사용 권한 정보를 보여 줍니다.
SOAP 헤더 | (In) TrustedUserHeaderValue (Out) ServerInfoHeaderValue |
필요한 권한 | 새 보고서 만들기: <xref:Microsoft.SharePoint.SPBasePermissions.AddListItems>Parent 및 <xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems> 에 정의된 데이터 원본 및 데이터 세트 Definition 기존 보고서 업데이트: <xref:Microsoft.SharePoint.SPBasePermissions.EditListItems> Report 에 정의된 데이터 원본 및 데이터 세트의 AND <xref:Microsoft.SharePoint.SPBasePermissions.ViewListItems>Definition |
매개 변수의 Parent
길이는 260자를 초과할 수 없습니다. 그렇지 않으면 오류 코드 rsItemLengthExceeded와 함께 SOAP 예외가 throw됩니다.
매개 변수는 Parent
null이거나 비어 있거나 예약된 문자를 : ? ; @ & = + $ , \ * > < | . "
포함할 수 없습니다. 슬래시 문자(/)를 사용하여 폴더의 전체 경로 이름에 있는 항목을 구분할 수 있지만 폴더 이름 끝에 사용할 수는 없습니다.
오류가 발생하면 보고서가 만들어지지 않습니다.
SharePoint 라이브러리에 보고서를 추가하면 부모 폴더의 및 ModifiedDate 속성이 수정됩니다ModifiedBy.
.rdl 파일 이름 확장명을 보고서 이름 rsFileExtensionRequired
에서 제외하면 오류가 반환됩니다.