How To…Create a Table of Contents


“How do I create a table of contents sorted by page at the beginning of my report?”


Use a group to separate out each topic in the table of contents.  During the first pass of the report, keep track of the current page inside the OnGroupBreak event for each group, then build the table of contents based on these values for the second pass of the report.


Sample Delphi code: