1단원: RDL Schema Visual Studio 프로젝트 만들기

새 설치: 2006년 7월 17일

이 자습서에서는 Microsoft Visual Studio 2005 개발 환경을 통해 간단한 콘솔 응용 프로그램을 만듭니다.

[!참고] SQL Server Express with Advanced Services에서 실행되는 보고서 서버 웹 서비스에 액세스하는 경우 "ReportServer" 경로에 "$SQLExpress"를 추가해야 합니다. 예를 들면 다음과 같습니다. http://myserver/reportserver$sqlexpress/reportservice2005.asmx"

콘솔 응용 프로그램을 만들려면

  1. 파일 메뉴에서 새로 만들기를 가리킨 다음 프로젝트를 클릭하여 새 프로젝트 대화 상자를 엽니다.

  2. Visual Basic 프로젝트 또는 Visual C# 프로젝트 폴더를 확장합니다.

  3. 콘솔 응용 프로그램 아이콘을 클릭합니다.

  4. 이름 입력란에 프로젝트 이름을 SampleRDLSchema로 입력합니다.

  5. 위치 상자에 프로젝트를 저장할 경로를 입력하거나 찾아보기를 클릭하여 원하는 폴더로 이동합니다.

  6. 확인을 클릭합니다. 프로젝트가 축소된 상태로 솔루션 탐색기에 나타납니다.

  7. 다음으로 ReportService2005 끝점에 웹 참조를 추가해야 합니다. 프로젝트 메뉴에서 웹 참조 추가를 클릭하고 보고서 서버의 URL 경로를 입력하거나 찾아보기 창의 옵션을 사용하여 해당 경로로 이동합니다.

  8. ReportService2005 끝점을 선택하고 ReportService2005웹 참조 이름으로 입력한 다음 참조 추가 단추를 클릭합니다.

    보고서 서버 웹 서비스에 연결하는 방법은 자습서: Visual Basic 또는 Visual C#을 사용하여 보고서 서버 웹 서비스에 액세스를 참조하십시오.

  9. 솔루션 탐색기에서 프로젝트 노드를 확장합니다. 기본 이름이 Program.cs(Visual Basic의 경우 Module1.vb)로 지정된 코드 파일이 프로젝트에 추가되었음을 확인할 수 있습니다.

  10. Program.cs(Visual Basic의 경우 Module1.vb) 파일을 열고 코드를 다음으로 바꿉니다.

    다음 코드는 로드, 업데이트 및 저장 기능을 구현하는 데 사용할 메서드 스텁을 제공합니다.

    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Text;
    using System.Xml;
    using System.Xml.Serialization;
    using SampleRDLSchema.ReportService2005;
    
    namespace SampleRDLSchema
    {
        class ReportUpdater
        {
            ReportingService2005    _reportService;
    
            static void Main(string[] args)
            {
                ReportUpdater reportUpdater = new ReportUpdater();
                reportUpdater.UpdateReport();
            }
    
            private void UpdateReport()
            {
                try
                {
                    // Set up the Report Service connection
                    _reportService = new ReportingService2005();
                    _reportService.Credentials =
                        System.Net.CredentialCache.DefaultCredentials;
                    _reportService.Url =
                       "http://myserver/reportserver/" +
                                       "reportservice2005.asmx";
    
                    // Call the methods to update a report definition
                    LoadReportDefinition();
                    UpdateReportDefinition();
                    PublishReportDefinition();
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine(ex.Message);
                }
            }
    
            private void LoadReportDefinition()
            {
                //Lesson 2: Load a report definition from the report 
                //          catalog
            }
    
            private void UpdateReportDefinition()
            {
                //Lesson 3: Update the report definition using the  
                //          classes generated from the RDL Schema
            }
    
            private void PublishReportDefinition()
            {
                //Lesson 4: Publish the updated report definition back 
                //          to the report catalog
            }
        }
    }
    
    Imports System
    Imports System.Collections.Generic
    Imports System.IO
    Imports System.Text
    Imports System.Xml
    Imports System.Xml.Serialization
    Imports SampleRDLSchema.ReportService2005
    
    Namespace SampleRDLSchema
    
        Module ReportUpdater
    
            Private m_reportService As ReportingService2005
    
            Public Sub Main(ByVal args As String())
    
                Try
                    'Set up the Report Service connection
                    m_reportService = New ReportingService2005
                    m_reportService.Credentials = _
                        System.Net.CredentialCache.DefaultCredentials
                    m_reportService.Url = _
                        "http://myserver/reportserver/" & _
                               "reportservice2005.asmx"
    
                    'Call the methods to update a report definition
                    LoadReportDefinition()
                    UpdateReportDefinition()
                    PublishReportDefinition()
                Catch ex As Exception
                    System.Console.WriteLine(ex.Message)
                End Try
    
            End Sub
    
            Private Sub LoadReportDefinition()
                'Lesson 2: Load a report definition from the report 
                '          catalog
            End Sub
    
            Private Sub UpdateReportDefinition()
                'Lesson 3: Update the report definition using the 
                '          classes generated from the RDL Schema
            End Sub
    
            Private Sub PublishReportDefinition()
                'Lesson 4: Publish the updated report definition back 
                '          to the report catalog
            End Sub
    
        End Module
    
    End Namespace 
    

다음 단원

다음 단원에서는 XML 스키마 정의 도구(Xsd.exe)를 사용하여 RDL 스키마의 클래스를 생성하고 이를 프로젝트에 포함시킵니다. 2단원: xsd 도구를 사용하여 RDL 스키마에서 클래스 생성을 참조하십시오.

참고 항목

작업

자습서: RDL 스키마에서 생성한 클래스를 사용하여 보고서 업데이트

관련 자료

Report Definition Language

도움말 및 정보

SQL Server 2005 지원 받기