formetting variable inside a richview
Hello,
Inside a tfrxrichview, if I use a variable say myvariable, which is declared in the report variables, I can get the value fine, but I cannot use an inline formatting. If I write inside the rich text [myvariable] everything is file, if I try to add inline formatting [myvariable #n%2.2f] I always get an error 'error in expression 'myvariable #n%2.2f' : ; expected
And of course, adding a semicolon, does not change anything
How can I get a variable containing an amount to be formatted with 2 decimals ?
thanks for your ideas
Didier
Inside a tfrxrichview, if I use a variable say myvariable, which is declared in the report variables, I can get the value fine, but I cannot use an inline formatting. If I write inside the rich text [myvariable] everything is file, if I try to add inline formatting [myvariable #n%2.2f] I always get an error 'error in expression 'myvariable #n%2.2f' : ; expected
And of course, adding a semicolon, does not change anything
How can I get a variable containing an amount to be formatted with 2 decimals ?
thanks for your ideas
Didier
Comments
try
[(<myvariable>)#n%2.2n]
I get exactly the same error message.
- I have been careful to add a space before the #
- I tried with and without the angled brackets
- I tried with and without the parenthesis, just in case
I am using the exact same syntax in a 'regular' tfrxmemoview and it is just fine;
As a workaround I tried formatting the variable before storing it but then any formatting just disappears when the variable is printed by FR.
The only thing that works is to make sure that the variable is a string, then FR leaves it alone & prints it as supplied. But this forces me to rewrite a somewhat complex piece of SQL query which I wanted to avoid doing
[(<myvariable>) #n%2.2n]
See attach
Thanks for the attachment.