I tried assigning a TIBCQuery to a TVirtualTable using the Assign method and it successfully copied all of the fields and values. However, it does not copy the "currency" property for TFloatFields. As a result, money values are displayed on my data-aware components as just regular floats without currency symbols or proper formatting.
Is there a way to somehow get the currency property values copied to the TVirtualTable?
Thanks in advance!!
Assign method ignores currency property value
-
- Posts: 5
- Joined: Wed 10 Jun 2009 21:28
-
- Posts: 5
- Joined: Wed 10 Jun 2009 21:28
Here is a procedure I just created which I will call after calling TVirtualTable.assign. This seems to work but perhaps there is a better solution?
Code: Select all
procedure CopyCurrencyFieldSettings(SrcDataset, DestDataset: TDataset);
var
srcField : TField;
begin
for srcField in SrcDataset.Fields do
begin
if (srcField is TFloatField) and
(srcField as TFloatField).currency then
(DestDataset.FieldByName(srcField.FieldName) as TFloatField).currency := true;
end;
end;