Topic: Fast Report Ordinal Number of day of the Date
I'm using [Now #dd] to reflect current day in number.
I want to add an ordinal suffix to it like 1st, 2nd, 3rd to 31st of the month.
How should I do it? Thanks!
My Visual Database → Reports → Fast Report Ordinal Number of day of the Date
I'm using [Now #dd] to reflect current day in number.
I want to add an ordinal suffix to it like 1st, 2nd, 3rd to 31st of the month.
How should I do it? Thanks!
Anyone? Pleasee
You should create an event OnAfterData for the memo
example:
procedure Memo12OnAfterData(Sender: TfrxComponent);
var
i: integer;
s: string;
begin
s := Memo12.Text;
s := ReplaceStr(s, #13#10, '');
if ValidInt(s) then
begin
i:= StrToInt(s);
if (i=1) or (i=21) or (i=31) then Memo12.Text := s + 'st'
else if (i=2) or (i=22) then Memo12.Text := s + 'nd'
else if (i=3) or (i=23) then Memo12.Text := s + 'rd'
else if ((i>=4) and (i<=20)) or ((i>=24) and (i<=30)) then Memo12.Text := s + 'th';
end;
end;
You should create an event OnAfterData for the memo
example:
procedure Memo12OnAfterData(Sender: TfrxComponent); var i: integer; s: string; begin s := Memo12.Text; s := ReplaceStr(s, #13#10, ''); if ValidInt(s) then begin i:= StrToInt(s); if (i=1) or (i=21) or (i=31) then Memo12.Text := s + 'st' else if (i=2) or (i=22) then Memo12.Text := s + 'nd' else if (i=3) or (i=23) then Memo12.Text := s + 'rd' else if ((i>=4) and (i<=20)) or ((i>=24) and (i<=30)) then Memo12.Text := s + 'th'; end; end;
Thank you. I think I can't use this since I'm just pulling day of the date using [Now] (Pulled from expression editor of Fast Report Designer)
Why you can't?
Just attach your project, I'll check it.
My Visual Database → Reports → Fast Report Ordinal Number of day of the Date
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi