RE: Formatting variable field as currency
I have a variable field on my report that I set equal to the sum of two
other fields in the dataset I'm reporting on. All works great until I set
the DisplayFormat of the variable field to $#,0.00;($#,0.00). This is the
same as the DisplayFormat used for some other currency fields (not variable
fields) in the report. After doing that, and then rerunning the report,
instead of seeing the value displayed there, I see the literal text $ , .
;($ , . ) instead of the numeric values. I'm obviously doing something
wrong here. What's the easiest way to get this variable field to be
formatted as a currency field?
other fields in the dataset I'm reporting on. All works great until I set
the DisplayFormat of the variable field to $#,0.00;($#,0.00). This is the
same as the DisplayFormat used for some other currency fields (not variable
fields) in the report. After doing that, and then rerunning the report,
instead of seeing the value displayed there, I see the literal text $ , .
;($ , . ) instead of the numeric values. I'm obviously doing something
wrong here. What's the easiest way to get this variable field to be
formatted as a currency field?
This discussion has been closed.
Comments
try a ppVariable and format your field within the onCalc event.
enjoy,
Ron.
Also, does DisplayFormat work differently than it does for other,
non-ppVariable fields? In other words, why can't I just use the
DisplayFormat?
just did it with RB 5.56 and it works fine. Make sure the variable's type
is double or currency.
procedure TForm1.ppVariable1Calc(Sender: TObject; var Value: Variant);
begin
ppVariable1.DisplayFormat := '$#,0.00;($#,0.00)';
Value := 20.55;
end;
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
to STRING! Ooops...changed it to currency and now all is well. Thanks.