2.06 How to Loop Data Pipeline?
// Might cause other problem
// Get Total Amount
var D : TfrxDataSet;
V : Variant;
s : string;
begin
D := Report.GetDataSet('Process');
V := 0;
D.First;
While not D.Eof do begin
V := V + D.Value('NetPay');
D.Next;
end;
s := 'Total Net Payable RM ' + FormatFloat('#,##.##;-#,##.##', V);
MessageDlg(s ,mtInformation, mbOk, 0);
end.
~0~
//Loop with condition
function GetEmployeeName(const lValue: string):String;
var D : TfrxDataSet;
begin
Result := lValue; //If Can't find
D := Report.GetDataSet('Employee');
D.First;
While not D.Eof do begin
if Trim(D.DisplayText('Code')) = Trim(lValue) then
begin
Result := D.DisplayText('Name');
Break;
end;
D.Next;
end;
end;