--------------------------------------------- Article: Currency Formatting in ReportBuilder ---------------------------------------------
Currently when formatting currency display formats, ReportBuilder internally calls FloatToStrF with a ffCurrency paramter.
This honors the Windows currency settings.
You can override this by setting Delphi's global variables for DecimalSeparator and CurrencyString. You will probably want to restore these values after printing the report.
Below is a simple example:
var lcSaveDecimalSeparator: Char; lsCurrencyString: String;
Comments
Article: Currency Formatting in ReportBuilder
---------------------------------------------
Currently when formatting currency display formats, ReportBuilder
internally calls FloatToStrF with a ffCurrency paramter.
This honors the Windows currency settings.
You can override this by setting Delphi's global variables for
DecimalSeparator and CurrencyString. You will probably want to restore
these values after printing the report.
Below is a simple example:
var
lcSaveDecimalSeparator: Char;
lsCurrencyString: String;
begin
lcSaveDecimalSeparator := DecimalSeparator;
lsCurrencyString := CurrencyString;
DecimalSeparator := '.';
CurrencyString := '$';
try
Report.Print;
finally
DecimalSeparator := lcSaveDecimalSeparator;
CurrencyString := lsCurrencyString;
end;
end;
For the end-user solution you may to code an event-handler
for the Report.Template.OnLoadEnd event to setup the proper settings.
--
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com