how to change the date format with code from delphi
Hi guys, I currently change the date format from the report
1.I select the field
2.-right click, I choose to edit
3.-format-> Category-> Date time
4.-format string "mm / dd / yyyy"
now I have the need of in the same report depending on the user wants to see the format string like "mm / dd / yyyy" or like this "dd / mm / yyyy", there is some way to tell fast report to take the regional configuration of the machine ??, or to be able to tell it to take a format with code ??, currently I work with delphi 10.3 and fast report vcl 6
thanks
Comments
use
var i: integer;
c: TObject;
m: TfrxMemoView;
begin
for i := 0 to frxReport1.AllObjects.Count - 1 do
begin
c := frxReport1.AllObjects.Items[i];
if c is TfrxMemoView then
begin
m := TfrxMemoView(c);
if m.DisplayFormat.Kind = fkDateTime then
m.DisplayFormat.FormatStr := 'dd / mm / yyyy';
end;
end;
end;
Thank you for your support, it works