TZParams compatibility Fastreport
Posted: 16.09.2021, 15:50
it would be possible because of compatibility
TZParmas
property Bound: Boolean read FBound;
in TParams
property Bound: Boolean read FBound write FBound;
{ Bound should be True in design mode }
Best regards,
Roland
TZParmas
property Bound: Boolean read FBound;
in TParams
property Bound: Boolean read FBound write FBound;
{ Bound should be True in design mode }
Code: Select all
procedure frxParamsToZParams(Query: TfrxCustomQuery; Params: TZParams);
var
i: Integer;
Item: TfrxParamItem;
begin
for i := 0 to Params.Count - 1 do
if Query.Params.IndexOf(Params[i].Name) <> -1 then
begin
Item := Query.Params[Query.Params.IndexOf(Params[i].Name)];
Params[i].Clear;
Params[i].DataType := Item.DataType;
{ Bound should be True in design mode }
if not (Query.IsLoading or Query.IsDesigning) then
Params[i].Bound := False
else
begin
if Item.Expression <> '' then
Params[i].Value := 0;
Params[i].Bound := True;
end;
if Trim(Item.Expression) <> '' then
if not (Query.IsLoading or Query.IsDesigning) then
if Query.Report <> nil then
begin
Query.Report.CurObject := Query.Name;
Item.Value := Query.Report.Calc(Item.Expression);
end;
if not VarIsEmpty(Item.Value) then
begin
Params[i].Bound := True;
if Params[i].DataType in [ftDate, ftTime, ftDateTime] then
Params[i].Value := Item.Value
else
Params[i].Value := Item.Value;
end;
end;
end;
Roland