다음을 통해 공유


ReportDocument.SetCssClass 방법

다양한 섹션 및 보고서 개체에 대한 CSS 스타일시트(CSS)를 설정합니다.

[Visual Basic]

Public Overrideable Sub SetCssClass( _
   ByVal objectScope As CrystalDecisions.Shared.ObjectScope, _
   ByVal cssClass As String _
)

[C#]

public virtual void SetCssClass(
   CrystalDecisions.Shared.ObjectScope objectScope, 
   string cssClass
);

매개 변수

  • objectScope
    스타일 클래스를 적용할 하나 이상의 보고서 섹션을 나타냅니다. 예를 들어, 전체 보고서에 대한 스타일을 설정하거나 보고서 머리글 섹션에 대한 스타일을 설정합니다.

  • cssClass
    스타일시트에 정의된 스타일 클래스의 이름입니다.

설명

스타일 클래스를 사용하여 보고서에 포함된 개체 및 섹션 서식을 재정의할 수 있습니다. CrystalReportViewer 컨트롤을 사용하여 볼 보고서에 대한 스타일 클래스를 설정합니다.

예제

다음 예제는 보고서의 본문 섹션에 대한 스타일 클래스를 설정합니다. 먼저, 스타일 클래스의 범위 값을 설정한 다음 스타일을 적용합니다.

[VJ#]

      private void setReportStyle(String styleName, char section) 
      {
         ObjectScope scope;
         switch(section)
         {
            case 'R':
               scope = 
                  ObjectScope.AllReportObjectsInGroupHeaderSections;
               break;
            case 'G':
               scope = 
                  ObjectScope.AllReportObjectsInGroupFooterSections;
               break;
            case 'D':
               scope = ObjectScope.AllReportObjectsInDetailSections;
               break;
            default:
               scope = ObjectScope.AllSections;
               break;
         }
         Report.SetCssClass(scope, styleName);
      }
      
[Visual Basic]

      Private Sub SetReportStyle _
         (ByVal styleName As String, ByVal section As String)
      
         Dim scope As New ObjectScope()
         Select Case (section)
            Case "GroupHeader"
               scope = _
                  ObjectScope.AllReportObjectsInGroupHeaderSections
            Case "GroupFooter"
               scope = _
                  ObjectScope.AllReportObjectsInGroupFooterSections
            Case "Detail"
               scope = ObjectScope.AllReportObjectsInDetailSections
            Case Else
               scope = ObjectScope.AllSections
         End Select
         Report.SetCSSClass(scope, styleName)
      End Sub 
      
[C++]

      void SetReportStyle(String* styleName, char section) 
      {
         ObjectScope scope;
      
         switch(section)
         {
            case 'R'
               scope = ObjectScope::AllReportObjectsInReportHeaderSections;
               break;
            case 'G':
               scope = ObjectScope::AllReportObjectsInGroupHeaderSections;
               break;
            case 'D':
               scope = ObjectScope::AllReportObjectsInDetailSections;
               break;
            default:
               scope = ObjectScope::AllSections;
               break;
         };
         Report->SetCSSClass(scope, styleName);
      }; 
      
[C#]

      private void SetReportStyle(string styleName, string section) 
      {
         ObjectScope scope = new ObjectScope();
         switch(section)
         {
            case "GroupHeader":
               scope = 
                  ObjectScope.AllReportObjectsInGroupHeaderSections;
               break;
            case "GroupFooter":
               scope = 
                  ObjectScope.AllReportObjectsInGroupFooterSections;
               break;
            case "Detail":
               scope = ObjectScope.AllReportObjectsInDetailSections;
               break;
            default:
               scope = ObjectScope.AllSections;
               break;
         }
         Report.SetCSSClass(scope, styleName);
      }
      

요구 사항

네임스페이스 CrystalDecisions.CrystalReports.Engine

어셈블리 CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

참고 항목

ReportDocument 클래스 | ReportDocument 멤버 | CrystalDecisions.CrystalReports.Engine 네임스페이스

**

©2005 Business Objects SA All rights reserved.

Business Objects SA
http://www.businessobjects.com/
지원 서비스
http://korea.businessobjects.com/services/