How to Draw a Database Table on a Drawing
The database import function is provided for the purpose of importing any dbase 3, 3+ or 4 database file onto a drawing. You may specify the tabular format (text size, column spacing, borders required etc.) and which fields and records you wish to import. This function will ensure that the text representing the database is aligned correctly during importation.
It is possible to import a single DBF file multiple times to different areas of the same DWG file. In this way you could, for example, place a bill of materials for devices on one side of your DWG layout and the bill of materials for terminals on the other side.
Column header blocks are inserted for each imported column. The column header blocks contain the configuration for the imported database table, which enables the database table data to be refreshed. The blocks are placed on a hidden layer: tableconf. When the table data is refreshed, the text and border lines are erased and redrawn.
Considerable customisation of the appearance of the imported tables can be done by modifying the configuration information stored within the column header blocks. For details about the column header blocks, see Attributes of Symbols.
Selectfrom the menu.
A list of database files in the current directory will be displayed. Select a file. (You can import a file from any directory).
The Import Database Text dialog will be displayed. The dialog is show above.
If you have used that database previously, your previously used settings for that database will be loaded into the interface.
Select the fields that you wish to import from the database file.
The list titled Fields in database shows all of the fields or columns from the selected database.
The list titled Fields to import shows the fields that you have selected to import.
Use the [>>] or [<<] buttons to add or remove all fields from the list of fields to import.
Use the [>] or [<] buttons to add or remove only selected fields from the list of fields to import.
Use the buttons to the right of the Fields to import list to re-order the imported fields.
The five border options are displayed graphically in an array of buttons. Click the button for the border you require.
If you do not want the name of each database field displayed at the top of each column on the drawing, clear the Show field titles checkbox.
Enter the spacing data and the first and last records to import.
Character spacing? This value is an estimate of the average character width. If you find that your data overruns the width of the columns increase this value. To minimise the space the imported data uses horizontally, decrease this value. Text height? Enter the height of the text that you wish to use. If you modify this you may need to modify the previous spacing value. Line spacing? Enter the size of the gap to leave between lines of data. Any horizontal border lines constructed are placed in the centre this gap. First record to import? Enter the first record to place on the drawing. Defaults to 1, the first record in the database. Last record to import? Enter the last record to place on the drawing. Defaults to the last record in the database.
You can choose to filter the data to include only the records that relate to the components found on the current drawing. To filter the data, tick the box "This drawings records only".
Click the [OK] button.
Pick the insertion point for the imported database. This will be the upper left corner of the table.
The function will insert a column header symbol for each column that you have selected to be imported.
The database file will be imported as a table.
Procedure to refresh the imported data
This function will refresh all of the imported database tables on the current drawing. The function operates without user interaction.
Selectfrom the menu.
The function will find and remove all text and lines that show the previous imported database data.
New text and lines will be inserted to show the current contents of any imported database tables.
You can refresh all of the imported database tables on all of the drawings in the current project from Ebase. See How to Update Databases Previously Imported in the Project (Ebase).
Modifying the appearance of the imported data
It is not possible to simply stretch the columns to move or re-size them.
The text and lines for each column are inserted from the insertion point of the column header for that column. The width to redraw a column is stored in an attribute of the column header block for that column.
The attributes of the column header blocks control most aspects of the databases representation within the drawing. By directly editing the column header blocks, you can also change the following:
Sorting of rows
Filtering of rows
For details about the column header blocks, see Attributes of Symbols.