Das Problem ist gelöst.
Es darf kein ds.Next; verwendet werden.
hier die funktionierende Version:
Delphi-Quellcode:
procedure DetailData1OnBeforePrint(Sender: TfrxComponent);
var
i: Integer;
ds: TfrxDataSet;
list: TStringList;
db_list: String;
begin
ds := Report.GetDataset('default');// username of ds
list := TStringList.Create;
ds.GetFieldList(list);
for i := 0 to list.Count -1 do
begin
if list[i]='PERSONS' then
begin
var_dist_persons.Visible := true;
dist_persons.Visible := true;
end;
//
if list[i]='WORKER' then
begin
var_dist_worker.Visible := true;
dist_worker.Visible := true;
end;
//
if list[i]='PLACEMENT' then
begin
var_dist_placement.Visible := true;
dist_placement.Visible := true;
end;
//
if list[i]='BEDS' then
begin
var_dist_beds.Visible := true;
dist_beds.Visible := true;
end;
//
if list[i]='Q_GIDEONS' then
begin
var_dist_q_gideons.Visible := true;
dist_q_gideons.Visible := true;
end;
//
if list[i]='CAT' then
begin
var_dist_cat.Visible := true;
dist_cat.Visible := true;
end;
end;
end;
Shalom
Manfred