Partager via


TimeFieldFormat Classe

Permet d'extraire et de définir les options de format d'heure pour les champs d'heure d'un rapport.

Pour obtenir la liste de tous les membres de ce type, voir les membres de la classe TimeFieldFormat.

System.Object
   CrystalDecisions.CrystalReports.Engine.EngineObjectBase
      CrystalDecisions.CrystalReports.Engine.ReportObjectProperty
         TimeFieldFormat

[Visual Basic]

Public Class TimeFieldFormat
   Implements IDisposable

[C#]

public class TimeFieldFormat : IDisposable

Remarques

Extrait l'objet TimeFieldFormat à l'aide de la propriété TimeFormat de l'objet FieldFormat.

Exemple

[VJ#]

      private TimeFieldFormat getTimeFieldFormat
         (String reportObjectName)
      {
         FieldObject field;
         TimeFieldFormat timeFormat = null;
      
         try
         {
            field = (FieldObject)Report.get_ReportDefinition()
               .get_ReportObjects().get_Item(reportObjectName);
            if (field.get_DataSource().get_ValueType() == 
               FieldValueType.TimeField)
               timeFormat = field.get_FieldFormat().get_TimeFormat();
         }
         catch (Exception e)
         {
         }
         return timeFormat;
      }
      
[Visual Basic]

      Function GetTimeFieldFormat _
         (ByVal reportObjectName As String) As TimeFieldFormat
      
         Dim field As FieldObject
         Dim timeFormat As TimeFieldFormat
      
         If TypeOf _
            (Report.ReportDefinition.ReportObjects._
            Item(reportObjectName)) Is FieldObject Then
            field = _
               Report.ReportDefinition.ReportObjects._
               Item(reportObjectName)
            If field.DataSource.ValueType = _
               FieldValueType.TimeField Then
               timeFormat = field.FieldFormat.TimeFormat
               GetTimeFieldFormat = timeFormat
           Else : GetTimeFieldFormat = Nothing
           End If
         Else : GetTimeFieldFormat = Nothing
         End If
      End Function 
      
[C#]

      private TimeFieldFormat GetTimeFieldFormat
         (string reportObjectName)
      {
         FieldObject field;
         TimeFieldFormat timeFormat;
         field =
            Report.ReportDefinition.ReportObjects[reportObjectName]
            as FieldObject;
         if (field != null) 
         {
            if (field.DataSource.ValueType == 
               FieldValueType.TimeField)
            {
               timeFormat = field.FieldFormat.TimeFormat;
               return timeFormat;
            }
            else return null;
         }
         else return null;
      }
      

Configuration requise

Espace de noms CrystalDecisions.CrystalReports.Engine

Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Voir aussi

TimeFieldFormat Membres | CrystalDecisions.CrystalReports.Engine Espace de noms

**

©2005 Business Objects SA. Tous droits réservés.

Business Objects SA.
http://www.france.businessobjects.com/
Services de support
http://www.businessobjects.com/support/