Printing 3 edits controls with CRLF
Leo Bidi
Montevideo, Uruguay
Hi all.
I need to print a variable's report with the values of 3 edits controls value, but these controls may or may not have values inside and if they have need to put CRLF
between them.
Example:
1 ) edit1.text = '', edit2.text = '', edit3.text = '', then there is nothing to print
2 ) edit1.text = 'AA', edit2.text = '', edit3.text = '' then only prints 'AA'
3 ) edit1.text = 'AA', edit2.text = 'BB', edit3.text = 'CC' then need to print
AA
BB
CC
no matther the combination of the edits values, I need to print a CRLF between the edits
My code is this
What am I missing or doing wrong ?? I am very confused with the quotes [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Many thanks !!![/img]
I need to print a variable's report with the values of 3 edits controls value, but these controls may or may not have values inside and if they have need to put CRLF
between them.
Example:
1 ) edit1.text = '', edit2.text = '', edit3.text = '', then there is nothing to print
2 ) edit1.text = 'AA', edit2.text = '', edit3.text = '' then only prints 'AA'
3 ) edit1.text = 'AA', edit2.text = 'BB', edit3.text = 'CC' then need to print
AA
BB
CC
no matther the combination of the edits values, I need to print a CRLF between the edits
My code is this
cComent := '';
if edit1.Text <> '' then
  cComent := Edit1.Text + #13#10;
if edit2.Text <> '' then
  cComent := cComent + edit2.Text + #13#10;
if edit3.Text <> '' then
  cComent := cComent + edit3.Text;
Report.Variables['Coment'] := '' + cComentario + ''
What am I missing or doing wrong ?? I am very confused with the quotes [img]style_emoticons/<#EMO_DIR#>/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> Many thanks !!![/img]
Comments
Does need any quotedstr() function in any of the edits ??
The documentation states that you must put quotes around the variables CONTENTS else it will be processed recursively like script.
It also says you shouldn't have CRLFs in the value, but it works if the outer quotes are omitted.
To set a variable to an empty string you have to use 6 singles quotes ('''''') in Delphi.
See:
http://www.fast-report.com/en/forum/?p=/discussion/comment/35768