set displayformat for frxCrossObject
How to format frxCrossObject in fastreport,
i dont know how to get access cell memo,
from demo PrintTable, i want set number format if field is numeric runtime
i dont know how to get access cell memo,
from demo PrintTable, i want set number format if field is numeric runtime
procedure TForm1.frxReportTableOriginalBeforePrint(Sender: TfrxReportComponent);
var
Cross: TfrxCrossView;
tmp : TfrxCustomMemoView;
i, j: Integer;
begin
if Sender is TfrxCrossView then
begin
Cross := TfrxCrossView(Sender);
FTabel.First;
i := 0;
while not FTabel.Eof do
begin
for j := 0 to FTabel.Fields.Count - 1 do
begin
Cross.AddValue(, [FTabel.Fields[j].DisplayLabel], [FTabel.Fields[j].Value]);
if FTabel.Fields[j] is TNumericField then
begin
tmp := Cross.CellMemos[j]; //
> FAILED
tmp.HAlign := haRight;
TfrxFormat(tmp.DisplayFormat).DecimalSeparator := ',';
TfrxFormat(tmp.DisplayFormat).Kind := fkNumeric;
TfrxFormat(tmp.DisplayFormat).FormatStr := '%2.0n';
end;
end;
FTabel.Next;
Inc(i);
end;
end;
end;