CHMlib Logo Leading Translation Management System for Translation Agencies, Top Translation Management Software for Freelance Translators, Time Tracking Software, Word Count, Character Count and Line Count Software, Computer Assisted Translation Tool for Easy Word Count, Clipboard Character Count Software, User-Friendly Translation Memory Software, Terminology Management Software, Terminology Management Server, Microsoft Glossary Software, Dictionary of Acronyms, Social Network for Translators and Translation Agencies, Acronyms and Abbreviations Search Engine, Russian Translation Lab, Ukrainian Translation Lab.
You are reading help file online using chmlib.com
CrisisHelper - First Aid in Tough Times of World Economic Crisis


Rave Reports Visual Designer

Example OnGetText .

Top  Previous  Next

How to use an event to change colors based upon fractional part of a DateTime field.

 

{ Event for dtLastEdit.OnGetText }

function dtLastEdit_OnGetText(Self: TRaveDataText; var Value: string);

var

nTime: Double;

iHour: Integer;

iMinute: Integer;

begin

nTime := Frac(StrToFloat(Value));

if nTime < 0.25 then

   self.Color := clRed;

   Value := 'Before Start';

   self.Left := self.Left + 0.1;

elseif nTime > 0.75 then

   self.Color := clYellow;

   self.Left := self.Left - 0.1;

   Value := 'After Hours';

else

   self.Color := clBlack;

   Value := '';

end if;

nTime := nTime * 24;

iHour := Trunc(nTime);

iMinute := Trunc(Frac(nTime) * 60);

If iMinute < 10 then

   Value := IntToStr(iHour)+':0'+IntToStr(iMinute);

else

   Value := IntToStr(iHour)+':'+IntToStr(iMinute);

end if;

end OnGetText;

 



You are reading help file online using chmlib.com

If you want your help file to be removed or added please send e-mail to chmlibcom@gmail.com