Extra content in Microsoft Word reports

Documents used as templates can contain more content and styling in addition to the iBase paragraph styles.

Documents used as templates can contain:

  • Logos and other graphics

  • A title page

  • Details of how the report was created.

  • A table of contents, typically added to the title page.

  • An end page

  • Table formatting

The different parts of the report are defined using section breaks. This type of template is specific to a single report definition because, the number of sections must match the number of link types, and the selected link style (whether tabular or list).

Section breaks

Section breaks in the template are used to separate the parts of the report. The sections are as follows:

Section

Description

Title

Contains a piece of text in the Microsoft™ Word style iBase Report Title, plus any other items you want, such as a logo or a table of contents. This section is mandatory.

Main Entity

Repeated for each main entity in the report. The section starts with a table that contains the icon (if specified) and the entity label in the Microsoft Word style iBase Entity Record Label. It is followed by a table with the entity field contents. This section is mandatory.

First Linked Entity

There is one section for each of the linked entity definitions and these are repeated for each main entity. Not required if there are no linked entities.

Second Linked Entity

The same as for the First linked entity, for however many linked entities that you specify .

End

After the last section break there is an area where you can add extra text such as completion details or a description of how the report was produced.

There are three types of section break available in Microsoft Word and you can use any of these to separate the sections of your report:

  • Next page inserts a section break and starts the next section on the next page.

  • Continuous inserts a section break and starts the next section on the same page.

  • Odd page or Even page inserts a section break and starts the next section on the next odd-numbered or even-numbered page.

Formatting a document as a template

The Microsoft Word document that you create should contain empty tables as placeholders for the data from iBase - all iBase data is displayed in Microsoft Word tables. For example, to force the entity record label to appear in the document, there should be a single cell table at the correct position that uses the Microsoft Word style iBase Entity Field Label Regular.

The simplest way to determine the correct position and style is to use an existing Microsoft Word report:

  1. In iBase, generate a report from the required report definition. Set up a simple report based on a single entity type and the required link types.

    Note:

    • Select tabular or list style for the link data before setting up the document as a template - changing this setting requires you to set up a new document.

    • There is no need to enter a report title - the report will always use the title that is entered in the document.

  2. In Microsoft Word, format the document as required.

  3. Tidy up the tables in the report that will hold the data:

    • Clear the row and heading cells in the tables so that the cells are empty.

    • Check that the tables are wide enough for their eventual contents.

    • You only need one row per table if using the tabular style.

    • Separate the tables in the template with at least one paragraph.

    • Format the tables using the formatting facilities in Microsoft Word (from the Table menu, select Table Designer) to modify the properties.

  4. From the File menu, select Save As and save the file in the same folder as your database. The file name should start with the name of the database, and have a .doc file extension (the file you have created is not a Microsoft Word Document Template).

  5. Test the styles in the document or template by generating an iBase report from it.

  6. The next step is to insert the section breaks, as described below.

Inserting section breaks

Before you can add additional content to a Microsoft Word document, you need to define the sections in the report by inserting section breaks:

  1. In Microsoft Word, open the required document; it will be located in the same folder as your database.

  2. Click the Show or Hide button on the Standard toolbar to display text markers and section breaks. Paragraph markers will be shown. From the View menu, select Normal.

  3. Enter the section breaks.

  4. Click on the paragraph marker at the position where you want to insert the section break - the break is inserted above the paragraph marker you select:

    To insert a...

    Click on the...

    Title section

    paragraph marker between the title and the first table

    Main Entity section

    paragraph marker below the table containing the entity data

    First Linked Entity section

    paragraph marker below the table containing the linked entity data

    End section

    This is created automatically when you insert the last section break.

  5. From the Insert menu, select Break. The Break dialog is displayed.

  6. In the Section break types area, select the type of page break and click OK. A section break is inserted.

  7. Save the file.

  8. Test the Microsoft Word document by producing an iBase report from it.

Adding material at the end of the report

In a Microsoft Word template with additional content, the End section of the report, the part that is after the final section break, does not contain any data from the report. You can use this area to add any details you want. For example, the document properties that are automatically generated when you produce a report:

  1. In Microsoft Word, select Insert > Field from the Insert menu, select Field.

  2. Select the Categories drop-down list, select Document Information.

  3. Insert the fields which are updated by iBase as required:

    • Author

    • Subject

    • Comments

To locate the end section of the report, click in the paragraph below the final section break.

Using a document with extra content to define the report

  1. In the report wizard, enter the details of the report in the usual way.

    Note: There is no need to enter a report title as this is taken from the Microsoft Word document.

  2. In the Output to area, select Microsoft Word and then specify a file name and location. You can choose any name and location.

  3. Turn on the Open report when complete checkbox to specify that you want to start Microsoft Word as soon as the report is ready.

  4. Turn on the Use styles in this template checkbox and select the required Microsoft Word document from the drop-down list. This will apply the paragraph styles from the document.

  5. Turn on Use template content to define report style to specify that you want to also use the contents of the document. This will apply the section breaks, table formatting, and content such as graphics.

  6. Click Finish. A progress dialog is displayed, followed by a completion dialog.

    Microsoft Word is started and the report is displayed.

  7. If the template contains any fields or a table of contents, you need to update them: Press Ctrl + A to select the whole report, and then press the F9 key to update all fields.

  8. Select Update entire table and click OK. All the fields are now updated.