Hello,
I want to change the format of a DateTime field on the report.Ifollowed this link: http://search.sap.com/notes?id=0001684809&boj=/sap/bc/bsp/spn/scn_bosap/notes.do?access=69765F6D6F64653D3939382669765F7361706E6F7465735F6E756D6265723D30303031363834383039
In fact i can change the DateTimeFormat of the field but not the DateFormat neither Timeformat of this datetime field, This is my code:
...
FieldObj= (CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject)Etat.ReportClientDocument.ReportDefController.ReportDefinition.FindObjectByName(FieldName);
FieldObj.FieldFormat.DateTimeFormat.DateTimeOrder =CrystalDecisions.ReportAppServer.ReportDefModel.CrDateTimeOrderEnum.crDateTimeOrderDateThenTime;
FieldObj.FieldFormat.DateTimeFormat.DateTimeSeparator = "-";
/*This part doesn't work*/
FieldObj.FieldFormat.DateFormat.DateOrder=CrystalDecisions.ReportAppServer.ReportDefModel.CrDateOrderEnum.crDateOrderMonthDayYear;
FieldObj.FieldFormat.DateFormat.MonthFormat=CrystalDecisions.ReportAppServer.ReportDefModel.CrMonthFormatEnum.crMonthFormatLongMonth;
FieldObj.FieldFormat.TimeFormat.TimeBase=CrystalDecisions.ReportAppServer.ReportDefModel.CrTimeBaseEnum.crTimeBase24Hour;
FieldObj.FieldFormat.TimeFormat.HourMinuteSeparator = "h";
FieldObj.FieldFormat.TimeFormat.MinuteSecondSeparator = "min";
...
It takes into account the DateTimeFormat properties and other unnoticed, it is true that the type of the fieldobject is datetime but how access its dateformat part and timeformat part?
Ps: we can not do FieldObj.FieldFormat.DateTimeFormat.DateFormat (it's not a property of DateTimeFormat)
Thanks