DateFieldFormat Classe
Permet d'extraire et de définir des options de format de date d'un champ date dans un rapport.
Pour obtenir la liste de tous les membres de ce type, voir les membres de la classe DateFieldFormat.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObjectProperty
DateFieldFormat
[Visual Basic]
Public Class DateFieldFormat
Implements IDisposable
[C#]
public class DateFieldFormat : IDisposable
Exemple
[VJ#]
private DateFieldFormat getDateFieldFormat
(String reportObjectName)
{
FieldObject field;
DateFieldFormat dateFormat = null;
try
{
field = (FieldObject)Report.get_ReportDefinition()
.get_ReportObjects().get_Item(reportObjectName);
if (field.get_DataSource().get_ValueType() == FieldValueType.DateField)
dateFormat = field.get_FieldFormat().get_DateFormat();
}
catch (Exception e)
{
}
return dateFormat;
}
[Visual Basic]
Private Function GetDateFieldFormat _
(ByVal reportObjectName As String) As DateFieldFormat
Dim field As FieldObject
Dim dateFormat As DateFieldFormat
If TypeOf _
(Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)) Is FieldObject Then
field = _
Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)
If field.DataSource.ValueType = _
FieldValueType.DateField Then
dateFormat = field.FieldFormat.DateFormat
GetDateFieldFormat = dateFormat
Else : GetDateFieldFormat = Nothing
End If
Else : GetDateFieldFormat = Nothing
End If
End Function
[C#]
private DateFieldFormat GetDateFieldFormat
(string reportObjectName)
{
FieldObject field;
DateFieldFormat dateFormat;
field =
Report.ReportDefinition.ReportObjects[reportObjectName]
as FieldObject;
if (field != null)
{
if (field.DataSource.ValueType == FieldValueType.DateField)
{
dateFormat = field.FieldFormat.DateFormat;
return dateFormat;
}
else return null;
}
else return null;
}
Configuration requise
Espace de noms CrystalDecisions.CrystalReports.Engine
Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
Voir aussi
DateFieldFormat 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/ |