kaju74
Oct 12 2006, 04:13 AM
Hi...
I like to pass a variable value from my delphi app to the report which should contains multiple lines. If I write something like this:
| CODE |
repEngine.Variables['HEADER'] := QuotedStr('Line1' + #13 + 'Line2');
|
...this didn't work. How do I seperate multiple lines using code...?
Regards,
Marc
MrSpock
Oct 12 2006, 06:57 AM
Hello kaju74,
the report variable expects an expression as value. #10 or #13 are not part of a valid expression as you can test by using the edit function of the variable in FR3.
What you could do, is to define a symbol which is not part of your string, but should represent the linebreak. Let's use a $ as example.
In Delphi you write then:
| CODE |
| frxRepRechnung.Variables['RepName'] := QuotedStr('Hello1$Hello2$Hello3'); |
And in your report you use a memo with the following code:
| CODE |
procedure Memo11OnBeforePrint(Sender: TfrxComponent); var posi : Integer; output : String; begin output := <RepName>; posi := Pos('$',output); while posi > 0 do begin Memo11.Text := Memo11.Text +Copy(output,1,posi-1)+#10#13; Delete(output,1,posi); posi := Pos('$',output); end; Memo11.Text := Memo11.Text +output; end; |
That should work for you.
kaju74
Oct 12 2006, 08:05 AM
Hi...
Thank you for answering. Well, this is a liltte bit circuitous but should work 8-)) Are there NO special characters (like \N) to solve this while writting...? If not, maybe that's a little improvement for FR4
creator
Aug 14 2009, 01:21 AM
Try this:
CODE
repEngine.Variables['HEADER'] := 'Line1'#13#10'Line2';