Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change currency from $ to Euro or another
Message
 
 
To
14/11/2018 11:03:40
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01663344
Message ID:
01663355
Views:
30
>>>>How would you go about changing the currency in all reports from a dollar sign to a euro sign or British pound sign or another?
>>>
>>>How is it specified currently? SET CURRENCY TO will change the currency symbol. But if it's encoded into a character string, you can use a ReportListener object and intercept the incoming string and replace all instances of the $ with something else.
>>>
>>>You can also open up each .FRX file as a .DBF and update the value you'd like to change if you have a way to set it globally. To find out what to change, copy the report, delete everything except the one thing you want to change as an example, and then compare the two frx files together using sys(2007, x) where x is each field name tested one-by-one in a loop until you find out which fields have changed.
>>
>>I don't think I have SET CURRENCY TO anywhere in the app; I think it is a literal dollar sign in the reports. So, I will need to change all reports to use the currency symbol and use the SET CURRENCY TO. I don't want to hack the .FRX files.
>>Thank you.
>
>You can use a ReportListener and add a class to monitor the incoming text, and swap out the $ for another symbol.
>
>See the ReportListener help for EvaluateContents() event. You can add that code to your system and swap out anything you see incoming that you'd like. Make sure to set oObjProperties.reload to .t. if you change anything.
>
>Using the FRX as a DBF and setting properties differently isn't exactly hacking. It's programmatically addressing the problem. There is a difference. :-)

I have never used ReportListener and don't know how much work is involved in changing hundreds of reports to use the ReportListener. Something to explorer.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform