Variables in expressions for checkbox
Hi
I am experimenting with building a report with Delphi and FR VCL5 with mostly static fields. The report is not based on a database with clear tabular format, but is a single page with text and some values dispersed in it.
My idea was to do it with variables, so I used frx memo components with vars written like [cat2.varname1]. The data for the variables is provided in the report's OnGetDocValue handler.
The above works for the textual display, but how can I use a variable name in the Expression of a TfrxCheckBoxView to set its checked/unchecked state?
For an integer value I tried something like "[cat1.myvar]=5" to set the box as checked. I tried also other combinations with and without square brackets and <>, but the variable name is not recognized properly. Instead of the var name, which in this case is "cat1.myvar", in the OnGetDocValue handler I receive the whole text of the expression "[cat1.myvar]=5".
Is this by design or I am not writing the syntax of the expression properly?
The var names contain dots, but this works in other parts of the report.
Thanks.
I am experimenting with building a report with Delphi and FR VCL5 with mostly static fields. The report is not based on a database with clear tabular format, but is a single page with text and some values dispersed in it.
My idea was to do it with variables, so I used frx memo components with vars written like [cat2.varname1]. The data for the variables is provided in the report's OnGetDocValue handler.
The above works for the textual display, but how can I use a variable name in the Expression of a TfrxCheckBoxView to set its checked/unchecked state?
For an integer value I tried something like "[cat1.myvar]=5" to set the box as checked. I tried also other combinations with and without square brackets and <>, but the variable name is not recognized properly. Instead of the var name, which in this case is "cat1.myvar", in the OnGetDocValue handler I receive the whole text of the expression "[cat1.myvar]=5".
Is this by design or I am not writing the syntax of the expression properly?
The var names contain dots, but this works in other parts of the report.
Thanks.
Comments
procedure CheckBox1OnBeforePrint(Sender: TfrxComponent);
begin
CheckBox1.Checked := <cat1.myvar> = 5;
end;