Controlling Which Records are Printed

TECH TIP: Controlling which records are printed for a report

There are a several techniques you can use to control which records are printed for a report.

  1. Use a Query to construct a result set containing only the desired records.
  2. Define a Filter on a dataset (Query or Table) to filter out the unwanted records.
  3. Use the DataPipeline.RangeBegin, RangeEnd, and RangeCount properties.
  4. Use the DataPipeline to traverse a list of bookmarked records. You can pre-process your data and determine which records to print. For each record, add a bookmark to the DataPipeline. For an example of this technique, see dm0112.pas in the main reports demo project.
  5. Use the DetailBand.BeforePrint event to set the DetailBand.Visible property to True or False based on some record value(s).
  6. Use the DataPipeline.OnFirst, OnNext, OnPrior, and OnLast events to control which records are skipped. For an example of this technique, see dm0116.pas in the main reports demo project.