|
Intro to the Data Source View
From NeoWiki
Reports and Forms are actually Writer documents stored within the odb file of your database. But you can also access the data in registered databases from Writer documents that are not stored within the odb file. This tutorial discusses some of the ways to access and use this data.
Contents |
Registering The Database
In order to access data in from Writer, the database must be registered. When you create a new database, the Database Wizard asks if you want to register the new database. Under normal conditions, you want to check Yes. If you accidently checked No, or if you have received an odb file from someone else, here's how to register the database:
- In the NeoOffice menu, choose Preferences
- Double-click on NeoOffice Base to disclose the sub-categories
- Click on Databases. You will see a list of registered databases.
- Click the New... button. The Create Database Link window appears
- Click the Browse... button and navigate to the database file you want to register.
- If desired, you may give it a Registered name different than the file path.
- Click OK in the Create Database Link window.
- Click OK in the Options-NeoOffice Base-Databases window.
Accessing the Datasource
- In an open Writer, document, click on the Data Sources button on the Standard Toolbar, or go to the View menu and select DataSources. The Data Source View opens just below the toolbars, above your document.
- In the Data Explorer (the left column with a list of data sources), click on the disclosure triangle next to the name of the database file you want to work with.
- Now click on the disclosure triangle next to Queries or Tables under the seleted database name.
- Select the specific Query or Table you want to work with for this document. (e.g. the All Sightings query). wait while the data loads. Note that the more complex the query, the longer you will need to wait. (The wait time may also be affected by available memory, CPU load, and processor speed).
- Make sure that the Table Data Toolbar is visible at the top of the Data Source View. It is the toobar that is circled in the image below:
- If this toolbar does not, appear, you will need to move or rename your preferences folder, as there does not seem to be any other way to turn it on from within the program. See the articles on corrupted preferences and Salvaging Settings from Preferences for directions. When I encountered this problem, I narrowed the troublesome spot down to the registry folder. Instead of moving the entire preferences folder, you might try moving/renaming just the registry folder. Note that you will lose data source registrations if you need to do this. See Registering the Data Source.
- Due to the fact that this toolbar cannot be turned back on without moving preferences, DO NOT close the Table Data toolbar.
Editing Data in Data Source View
In some cases, you can actually edit your data in the Data Source View in Writer.
- You can edit data in:
- Tables that are part of an embedded database (using the HSQLDB engine, as we have done in this tutorial)
- You cannot edit data in:
- Queries (just as you cannot edit data in any Query in Base that combines two or more tables).
- Tables that connect to a spreadsheet.
- Tables from the Mac Address book.
- The ability to edit tables in Base files which connect to other database engines will vary. Users who connect to other database engines are encouraged to add details to this section. Make sure to specify connection type. If you don't have a wiki editing account, you may send a private message Lorinda at trinity with the information. (Note that you need to be a registered user at trinity to use its private message function.)
- Note: The Edit Data button on the Table Data toolbar must be highlighted to edit data. (It looks like a sheet of paper with a pencil over it). If you don't want to accidentally edit data while working with a data source, click this button to un-highlight it, and you will be unable to edit data. This same button will be dimmed if the current data source type does not permit editing.
- To edit an existing record in Data Source View, click in the cell containing the data you want to edit. A blinking cursor will appear in the cell and you can edit the contents.
- To add a record, scroll down to the bottom of the visible data. You will see a blank record with a sunburst icon in the far left grey square. Click anywhere in this record, and begin typing to add the new record. (Note that the starburst icon moves down one more record as soon as you start typing.)
- To delete an existing record, control-click or right-click in the small unlabled "cell" on the far left of the data table. Select Delete rows from the contextual menu.
Filtering Data in Data Source View
Sorting Data in Data Source View
Inserting Fields from the Data Source
Adding Fields in the flow of your document
Quickly Creating a Writer Table
Using the Next Record Field
Issues with Image Fields
Creating Forms in Writer Documents
Forms are not limited to those stored within an odb file. You can also create a form in an "independent" or "external" Writer document. When working with forms, you do not use the Data Source View.
- Make Sure that the Form Controls and Form Design toolbars are visible. If they are not, go to the View menu, choose Toolbars and select the needed toolbars.
- Click on the Form button. The Form Properties window should appear.
- You can also reach the Form Properties window by clicking on the Form Navigator button, control-clicking on the name of the form (most likely Standard), and choosiing Properties.
- Click on the Data tab.
- Click on the ... next to Data Sources and browse to locate the desired data source
- Set the Content type for Table or Query, depending on your source. Those familiar with SQL can also choose SQL Command
- Select the desired Query or Table from the Content drop-down
- Adjust other settings as desired, and close the Form Properties window.
From this point on, editing forms in an independent Writer document should work the same way editing forms stored in he odb file do.
Related Wiki Links
Using the Mail Merge Wizard
Various Form Tutorials in the To Base and Back Again series.