Delphi value to FastReport
I'm trying to pass a richedit delphi value for FastReport but it passes the value he is entering ' before and after the value.
Example:
Richedit.text = 'Example Text';
when I move to the FastReport looks like this:
'Example Text'
I want to take '
I want the value to be passed this way:
Example Text
CODE:
Example:
Richedit.text = 'Example Text';
when I move to the FastReport looks like this:
'Example Text'
I want to take '
I want the value to be passed this way:
Example Text
CODE:
frxReport1.Variables['var1'] := QuotedStr(richedit.text);
Comments
I have found that if a FastReport variable's new value has a CRLF in it, then the outer quotes get printed, otherwise they are required to stop FR doing a recursive variable lookup.
I have a function like this:
None of my variables have internal quotes, so I've never tried to use QuotedStr.
You may have to do something like copy(tempstr, 2, length(tempstr) - 2) to strip the quotes if there's a CR in there, or cut the length by one and delete the first char