DateTimeFieldFormat 클래스
보고서의 날짜-시간 필드에 대한 날짜 및 시간 형식 옵션을 가져오고 설정할 수 있습니다.
이 형식의 멤버 목록을 보려면 DateTimeFieldFormat 멤버를 참조하십시오.
System.Object
CrystalDecisions.CrystalReports.Engine.EngineObjectBase
CrystalDecisions.CrystalReports.Engine.ReportObjectProperty
DateTimeFieldFormat
[Visual Basic]
Public Class DateTimeFieldFormat
Implements IDisposable
[C#]
public class DateTimeFieldFormat : IDisposable
예제
다음 예제는 FieldFormat 개체의 DateTimeFormat 속성을 사용하여 DateTimeFieldFormat 개체를 검색합니다.
[VJ#]
private DateTimeFieldFormat getDateTimeFieldFormat
(String reportObjectName)
{
FieldObject field;
DateTimeFieldFormat dateTimeFormat = null;
try
{
field = (FieldObject)Report.get_ReportDefinition()
.get_ReportObjects().get_Item(reportObjectName);
if (field.get_DataSource().get_ValueType() ==
FieldValueType.DateTimeField)
dateTimeFormat = field.get_FieldFormat().get_DateTimeFormat();
}
catch (Exception e)
{
}
return dateTimeFormat;
}
[Visual Basic]
Private Function GetDateTimeFieldFormat _
(ByVal reportObjectName As String) As DateTimeFieldFormat
Dim field As FieldObject
Dim dateTimeFormat As DateTimeFieldFormat
If TypeOf _
(Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)) Is FieldObject Then
field = _
Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)
If field.DataSource.ValueType = _
FieldValueType.DateTimeField Then
dateTimeFormat = field.FieldFormat.DateTimeFormat
GetDateTimeFieldFormat = dateTimeFormat
Else : GetDateTimeFieldFormat = Nothing
End If
Else : GetDateTimeFieldFormat = Nothing
End If
End Function
[C#]
private DateTimeFieldFormat GetDateTimeFieldFormat
(string reportObjectName)
{
FieldObject field;
DateTimeFieldFormat dateTimeFormat;
field =
Report.ReportDefinition.ReportObjects[reportObjectName]
as FieldObject;
if (field != null)
{
if (field.DataSource.ValueType ==
FieldValueType.DateTimeField)
{
dateTimeFormat = field.FieldFormat.DateTimeFormat;
return dateTimeFormat;
}
else return null;
}
else return null;
}
요구 사항
네임스페이스 CrystalDecisions.CrystalReports.Engine
어셈블리 CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
참고 항목
DateTimeFieldFormat 멤버 | CrystalDecisions.CrystalReports.Engine 네임스페이스
©2005 Business Objects SA All rights reserved.
Business Objects SA http://www.businessobjects.com/ 지원 서비스 http://korea.businessobjects.com/services/ |