You can resort to any of this methods:
Filter
Your original DataSet (if the DataSet is capable of filtering). You usually write a a la SQL filter, like this:
MyDataSet.Filter := 'MYCOLUMN in (''a'', ''b'', ''c'')';
MyDataSet.Filtered := True;
Or write a OnFilterRecord
event to exclude/include the records you want to show in the report.
procedure TMyForm.MyDataSetFilterRecord(DataSet: TDataSet; var Accept: Boolean);
begin
Accept := (DataSet.FieldByName('MYFIELD').AsInteger mod 7 = 0) or
(DataSet.FieldByName('MYOTHERFIELD').AsInteger in MySetOfValues);
end;
TFrxDBDataSet events
You can also resort to the events of the TfrxDBDataSet
component you usually use to bind your report to the data. Write a OnOpen
, OnFirst
, OnNext
, OnCheckEOF
event handlers to prevent the report to include all the records by "stoping" only on the records of your interest.
For example, if you want to print each second row, you could write this:
procedure TMyForm.fdsEstPagosNext(Sender: TObject);
begin
MyDataSet.Next;
MyDataSet.Next; //advance not one, but two records.
end;