[Lazarus] Lazreport variables

Santiago A. svaa at ciberpiula.net
Sun May 3 18:03:12 CEST 2020


I want to write a report where even lines are written with no background 
and odd lines with a light gray background.
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.

I have created a report variable "LineCounter"

In the ColumnHeader band (the report has two columns) I have a Script


In the GorupHeader header I have this script


In the masterData band Script:

  MemoBackground.visible:=(LineCounter mod 2 = 0);

When I prepare the report, I get "Invalid Variant Type Cast"

After debugging a little, I have found LineCounter is undefined when it 
is on the right side of assignment.
When It executes  LineCounter:=0; it assigns to a frVariables, a global 
public var in Unit LR_Class.
But when it tries to get its value it searches en a field "values" of 

I've also tried


With brackets, the same result. (Not sure what brackets are for in scripts)

Any hint? What am I missing?


Santiago A.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200503/c5382c7d/attachment.html>

More information about the lazarus mailing list