Sum the Employee PF Withdraw column and after that subtract with total pf and stored in total provident fund but it doesnot work for more than two rows.
qrytbl.Reset();
qrytbl.SetRange(/CNIC NO../, rec.CNIC);
pftbl.Reset();
pftbl.SetRange(CNIC, rec.CNIC);
if qrytbl.FindSet() then begin
if pftbl.FindSet() then begin
pftbl.SetFilter(CNIC, rec.CNIC);
if pftbl.Find('-') then begin
repeat
myint := pftbl./ Employee PF Withdraw / + / Employee PF Withdraw /;
// / Employee PF Withdraw / := Rec./ Employee PF Withdraw / + xRec./ Employee PF Withdraw /;
// myint := / Employee PF Withdraw /;
// pftbl.CalcFields(/ Employee PF Withdraw /);
// pftbl./ Employee PF Withdraw / += pftbl./ Employee PF Withdraw /; //+ rec./ Employee PF Withdraw /;
until pftbl.Next() > 0;
end;
// pftbl.CalcSums(/ Employee PF Withdraw /);
pftbl.CalcSums(/ Total PF /);
qrytbl.TotalProvidentFund := pftbl./ Total PF / - myInt;//((pftbl./ Employee PF Withdraw / - xRec./ Employee PF Withdraw /) +)
// qrytbl.Modify(true);
qrytbl.Modify();
end;
// end;
end;