Hi,
I found this problem setting HideZeroValues to true.
The procedure:
procedure TfrReport.GetVariableValue(const s: String; var aValue: Variant);
in LR_Class checks the status of the flag for every variable in the formula using the code below:
//check if CurView is TfrBandView to avoid clash with flBandPrintChildIfNotVisible. Issue 29313
if Assigned(CurView) and ((CurView.Flags and flHideZeros <> 0) and not (CurView is TfrBandView)) then
begin
if TVarData(aValue).VType in [varSmallInt, varInteger, varCurrency,
varDecimal, varShortInt, varByte, varWord, varLongWord, varInt64,
varQWord, varDouble, varSingle] then
begin
if aValue = 0 then
aValue:=Null;
end;
end;
If one variable has zero value the procedure return Null.
This provokes an error in the formula calculation resulting in a report not completely created.
I found a workround by commenting the code above and inserting the code below in the procedure (dummy is an integer variable)
procedure TfrCustomMemoView.ExpandVariables;
var
...
dummy:integer;
...
for i := 0 to Memo.Count - 1 do
begin
s := Memo[i];
if Length(s) > 0 then
begin
GetData(s);
//NEW CODE
if Assigned(CurView) and ((CurView.Flags and flHideZeros <> 0) and not (CurView is TfrBandView)) then
if TryStrToInt(s,dummy) then if dummy=0 then s:='';
//END OF NEW CODE
Memo1.Add(s)
end
else
Memo1.Add('');
end;
---
This work in my case BUT I'm not sure this is the correct way to fix the problem.
Regards