Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Creating an sorted index

edited September 2002 in General
Hi,
I need to create an index on a list of companies in a report. The companies
in the report are ordered by an internal number. The index on the companies
should list the company name and its page number where it is listed in the
report. However, the index should list the companies in alphabetical order.
Finally, we don't know in advance how many companies will be listed in the
report, it can vary.

I know there is a way to list a company and its page number as is done in a
table of contents. But is there a way to do this when the ordering of the
companies in the index is specified in a different order than they are in
the actual report?

We are using RB Enterprise Edition version 5.0. We are not able to upgrade
at this time.

Thanks in advance.
Prathy Kukkalli

Comments

  • edited September 2002
    You'll need to build a list of page numbers and corresponding companies. I
    would create a little class to do this and stick these objects in a TList.

    In the report, use a TppVariable and its OnCalc event to check the current
    record for the company and the page number. If the company doesn't exist in
    the list, then add it.

    One solution is to generate a lookup dataset with the companies ordered and
    simply place a subreport in the summary band of the report connected to this
    lookup data pipeline. Then as each detailband prints in the subreport, pull
    the page number from the list based on the company name.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.