Intro to the Data Source View

From NeoWiki

Revision as of 22:22, 7 November 2007 by Lorinda (Talk | contribs)
Jump to: navigation, search
This article is part of the To Base and Back Again tutorial series.

Reports and Forms are actually Writer or Calc 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 or Calc, 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:

  1. In the NeoOffice menu, choose Preferences
  2. Double-click on NeoOffice Base to disclose the sub-categories
  3. Click on Databases. You will see a list of registered databases.
  4. Click the New... button. The Create Database Link window appears
  5. Click the Browse... button and navigate to the database file you want to register.
  6. If desired, you may give it a Registered name different than the file path.
  7. Click OK in the Create Database Link window.
  8. Click OK in the Options-NeoOffice Base-Databases window.


Accessing the Datasource

  1. In an open Writer or Calc 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.
  2. In the Data Explorer (the left column with a list of data sources; see the picture below), click on the disclosure triangle next to the name of the database file you want to work with.
  3. Now click on the disclosure triangle next to Queries or Tables under the seleted database name.
  4. 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).
  5. Make sure that the Table Data Toolbar is visible at the top of the Data Source View. See the picture 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.


Anatomy of the Data Source View


Image:DataSources.png

Resizing/Hiding the Data Source View

  • To hide the Explorer, click on the Explorer On/Off button on the Table Data Toolbar. (It looks like a folder with a magnifying glass).
  • To resize the height of the Data Source View, move the mouse to bar just below the Data Source View navigation bar; the cursor will become two horizontal lines with arrows pointing up and down. Hold down the mouse button and drag the bottom of the Data Source View pane up or down to the desired size.
  • To hide the Data Source View, you can:
    Click on the Data Sources button on the toolbar
    Click on the row of dots (or tiny squares) in the middle of the resizing bar just below the Data Source View navigation bar
    Go to the View menu and select Data Sources.


Adjusting the Appearance of the Data

With the Data Source View open, there are several things you can do to change the appearance of the data.

  • To change the formatting data in a particular column (e.g. the Date column in the Field Trips table), right-click or control-click on the column heading (e.g. Date) and select Column Format... from the contextual menu. A Field Format window will open where you can adjust the formatting.
  • To change the font and font formatting used in the table data, right-click or control click on any of the grey "cells" to the left of a record and choose Table Format... from the contextual Menu.
  • To change the width of the column, there are two options:
    Place your cursor on the border between the two columns. The cursor icon will change to a line with arrows pointing left and right. Hold down the mouse button and drag the border to the desired location
    Control-click or right-click on the column heading and choose Column Width... from the contexual menu. In the window that appears, alter the column width as desired.
  • To hide a column (i.e. if you don't need to see/work with that data) control-click or right-click on the column heading and choose Hide Columns from the contextual menu.
  • To change the height of the column, control-click or right click on the grey box to the left of any row and choose Row Height... from the contextual menu. Uncheck Automatic (if it is checked) and type in the desired height in the appropriate box.
    • To show a previously hidden column, control-click or right-click on any column heading and choose Show Columns and then the column you want to show. (Note that Show Columns only appears is one or more columns are actually hidden).


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:
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. (Or click on the sunburst icon on the navigation bar at the bottom of the Data Source View). 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 in the far left square 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.

If you are unable to edit your data in the Data Source View, or if you prefer to enter/edit data in the database file itself (for example, field trip and sightings data is best entered in the Field Trips Data Entry form), you can control-click or right click on the icon next to the name of the query, table, or data source in the Explorer and select Edit Database... from the contextual menu.


Next Steps

Filtering in the Data Source View
Sorting in the Data Source View
Inserting Data from the Data Source View into a Writer Document

Related Wiki Links

Using the Mail Merge Wizard
Various Form Tutorials in the To Base and Back Again series.

External Links


This article in other languages: Français
Personal tools