Page 1 of 1
How to output { in expressions
Posted: Mon Oct 13, 2008 11:01 am
by mace242
I want to have an expression that outputs { and also does a calculation. If it was any other character I would do this.
# {SomeCalculation()}
I want to do this
{{SomeCalculation()}}
to output
{100}
is the only way
{"{"+SomeCalculation.ToString()+"}"}?
Thanks.
How to output { in expressions
Posted: Mon Oct 13, 2008 11:08 am
by johnham
Haven't tried this myself but my suggestion would be using the escape operator ("\") like so...
or try doubling the operator up like so...
Like I said, I haven't tried either and I haven't got the Report Designer in front of me at this very moment but try those and let me know. I am curious as to what the outcome will be.
How to output { in expressions
Posted: Mon Oct 13, 2008 11:34 am
by Brendan
These are the alternatives I know of
Code: Select all
{"{"}{Line}{"}"}
{"{" + Line.ToString() + "}"}
{String.Format("{{{0}}}", Line)}
{Format("{{{0}}}", Line)}
The first one is probably the closest to what you want
How to output { in expressions
Posted: Tue Oct 14, 2008 2:25 am
by mace242
johnham wrote:Haven't tried this myself but my suggestion would be using the escape operator ("\") like so...
or try doubling the operator up like so...
Like I said, I haven't tried either and I haven't got the Report Designer in front of me at this very moment but try those and let me know. I am curious as to what the outcome will be.
I tried both of those and neither works. Just so you know. Thanks for the try anyway.
How to output { in expressions
Posted: Tue Oct 14, 2008 12:14 pm
by Edward
Hello.
Please inform us about version you are using. Have you tried to add above suggestions in the Text property of the report template?
Maybe you trying to do it in run time? In that case please use GetValue event of the StiText component:
e.Value = "{"+5+6+"}";
Thank you.