How to concatenate two fields or two strings.
There is a thing that has been bothering me since this morning.
I cannot get two strings or two fields to concatenate one another.
I tried this:
fieldA + " " + fieldB
and I get the value of fieldA but fieldB remains "fieldB" not showing its value:
Truman + " " + fieldB is what is being printed.
I really cannot understand.
Thanks.
This discussion has been closed.
Comments
Each expression must be in brackets. Try the following expression:
[[fieldA ] + " " + [fieldB]]
Thank you again. It works.
Hello!
The reason lies in the syntax of the expressions: if you write `fieldA + “ ” + fieldB` without square brackets or without brackets around the field, FastReport treats the text outside the [...] as a regular string.
Use a compound C# expression enclosed in square brackets:
[[Table.fieldA] + “ ” + [Table.fieldB]]