ReportDocument.SetCssClass Método

Establece la hoja de estilos en cascada (CSS) de varias secciones y objetos de informe.

[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
);

Parámetros

  • objectScope
    Indica las secciones del informe a las que se aplicará la clase de estilo. Por ejemplo, establezca el estilo para todo el informe o para la sección Encabezado de informe.

  • cssClass
    El nombre del estilo de la forma definida en la hoja de estilos.

Observaciones

La clase de estilo se puede utilizar para anular los formatos de objeto y sección contenidos en el informe. Establezca la clase de estilo de los informes que se verán mediante el control CrystalReportViewer.

Ejemplo

El siguiente ejemplo establece la clase de estilo de la sección de detalles de un informe. Primero establece el valor de ámbito para la clase de estilo y, a continuación, aplica el estilo.

[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);
      }
      

Requisitos

Espacio de nombres CrystalDecisions.CrystalReports.Engine

Ensamblado CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Vea también

ReportDocument Clase | ReportDocument Miembros | CrystalDecisions.CrystalReports.Engine Espacio de nombres

**

©2005 Business Objects SA Reservados todos los derechos.

Business Objects SA
http://www.spain.businessobjects.com/
Servicios de soporte
http://www.spain.businessobjects.com/Servicios/soporte.htm