There's a script in memo of LazReport:
VS1:= VS1 + [sqlMain."S1"];
where
VS1 - a variable that is passed to a report from the code like this:
This variable is transmitted without errors and if the register in the memo [VS1], it displays "5".
[sqlMain."S1"] - field of TSQLQuery. Output "6" in the memo without problems, if simply register [sqlMain. "S1"].
But when I run a report for the
VS1:= VS1 + [sqlMain."S1"];
I get an error
Invalid variant operation on string
result := V1 + V2 in code of file lr_pars.pas:
function SumOrConcat(const V1,V2: Variant): Variant;
begin
if VarIsStr(V1) then
result := V1 + VarToStr(V2)
else
if VarIsStr(V2) then
result := VarToStr(V1) + V2
else
result := V1 + V2
end;
If you look at the values V1 and V2 under the debugger, you will get:
V1 = 5V2 = unsupported variant type: TFMTBCDFactoryHow do I fix this?