<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">El 07/05/2020 a las 05:37, Jesus Reyes
A. via lazarus escribió:<br>
</div>
<blockquote type="cite" cite="mid:op.0j79o7qgii0r0k@hpalex">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css">body { font-family:'Courier New'; font-size:13px}</style>
En Sun, 03 May 2020 11:03:12 -0500, Santiago A. via lazarus
<a class="moz-txt-link-rfc2396E" href="mailto:lazarus@lists.lazarus-ide.org"><lazarus@lists.lazarus-ide.org></a> escribió:<br>
<br>
<blockquote style="margin: 0 0 0.80ex; border-left: #0000FF 2px
solid; padding-left: 1ex"> Hi:<br>
<br>
I want to write a report where even lines are written with no
background and odd lines with a light gray background.<br>
The idea is an memo (MemoBackground) in the background of the
masterData Band that is gray and I set visible or invisible,
according with the line.<br>
<br>
I have created a report variable "LineCounter"<br>
<br>
In the ColumnHeader band (the report has two columns) I have a
Script<br>
<pre>Begin
LineCounter:=0;
end;</pre>
In the GorupHeader header I have this script<br>
<pre>Begin
LineCounter:=0;
end;</pre>
In the masterData band Script:<br>
<pre>begin
LineCounter:=LineCounter+1;
MemoBackground.visible:=(LineCounter mod 2 = 0);
end</pre>
</blockquote>
<div><br>
</div>
<div>Probably the easiest way of doing what you want is using an
empty memo object sized to the extent you want for the
background row, any other field on the band should be 'above'
the background memo (you can just select the background memo and
press the 'send to bottom' tool button), any field on the band
should be transparent color. Then edit the background memo and
use this script:</div>
<div><br>
</div>
<div>if [LINE#] mod 2 = 0 then</div>
<div> FillColor := clGray<br>
else</div>
<div> FillColor := clWhite; </div>
<div><br>
</div>
<div>As written and because the variable Line# starts at 1, the
first line will be white.</div>
<div><br>
</div>
<div>You can apply this method to any existing report as it
doesn't require modifying the source code of your application. </div>
<div><br>
</div>
<div>Regards.</div>
<div><br>
</div>
<div>Jesus Reyes A.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
</blockquote>
<br>
Ok I'll try<br>
Nevertheless, that doesn't answer my question: How to use
"not-predefined" variables. How can I access to the variable
lineCounter?<br>
<br>
<br>
<pre class="moz-signature" cols="72">--
Saludos
Santiago A.
</pre>
</body>
</html>