How to create cross-reference indexes
How can I create cross-reference indexes?
With CatBase it's easy to create an index: you simply select the Index this Element
option in the Preferences
tab for the Element you want to build an index on (e.g. Company Name, Last Name, ID Number, etc.).Then, after you have published your data, you can use the publishing destination's built-in index-building feature to create your index.
But what if you want a more complex index? For example, in addition (or instead of) creating a simple index of company names, or last names, or whatever, you want to create an index by category, or by country, or by county, etc. Maybe even multiple
indexes by different criteria. The process is quite easy with CatBase:
- When you set up your Publishing Style Sheet, index a unique field. The best field to use for this is the RecordNumber, as that is guaranteed to always be unique. You can use another field - such as Company Name - if you're confident that all company names are unique within the database
- If you don't want the indexed field to be printed in the publication, create a Character Style called "hidden" or something like that, and apply it to the indexed Element (on the Element's Preferences page, select your "Hidden" Character Style from the Character Style popup menu)
- If the indexed field is a numeric field, such as the RecordNumber, select the Number Format button on the Element Preferences page and make sure that the number style is plain with no decimals places and no monetary unit
- Publish the data
- In your layout (Quark, InDesign, Word etc.) modify the Hidden character style - make it very tiny, perhaps with very tight tracking, and give it no colour or "paper" colour)
- Finalise the layout and save it
- Build the index. You just want a simple index that includes the indexed item (company name, record number, etc.), followed by a Tab, followed by the page number(s). You don't want any headings; if it creates them, delete them.
- Save the index as a plain text file
- It is a good idea to check the text file. Open it up in a text editor or word processor, or a text box in your page layout program, and check that it's in the correct format: plain text; one entry per line containing the index key, a tab, and the page number(s)
Next, you will import that text file back into CatBase and use it to update a Page Number field in the database. Once you have the page numbers in the database, you'll be able to create all the indexes you want.
If you are not confident about this step, it might be a good idea to make a backup of your database before proceeding (that's the file with the .4dd file extension).
- You'll need to have a Page Numbers field in your database. Let's say your table is called Companies. If you don't already have a Page Numbers field in the Companies table, create one. It will need to be a String type field.
- Create a new Import Style. Give it a name and select the Companies table from the Import into Table popup menu.
- Click on the Select button, locate your index text file, and double-click on it
- Map the two fields: the first field will be your "key" field such as the RecordNumber of Company Name, and the second field will be your Page Number field
- Go to the Updates tab
- Select the third radio button: Update existing records
- Your key field will probably be selected in the Primary Key Field popup. Make sure that it is.
- Go back to the Main tab
- Click the Import Now button
- Your data will be imported. When it's done, open a record to check that the page number(s) have been imported.
Finally, publish your cross-ref index(es).
- Create a new Publishing Style Sheet
- Add a Paragraph and choose a suitable Paragraph Style for it
- Add the Elements you need - e.g. Company Name, a Tab, and the Page Numbers
- Go to the Prefs tab and choose the sort order
- Save it
You're now ready to publish the index!
You can build any number of indexes this way, sorted by Category or whatever.