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.
- Use a Query to construct a result set containing only the desired records.
- Define a Filter on a dataset (Query or Table) to filter out the unwanted records.
- Use the DataPipeline.RangeBegin, RangeEnd, and RangeCount properties.
- 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.
- Use the DetailBand.BeforePrint event to set the DetailBand.Visible property to True or False based on some record value(s).
- 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.