Copyright: Copyright © 1998 Ability Plus Software (UK) Ltd.


Integration in Ability

Integration is a term used to describe how different applications work together and especially how they share data.

There are three main ways Ability can share information:

1.	Copy and paste (see Copy and paste) – a simple copy of data from one application to the next.

2.	Linking through fields (see Linking through fields) – sharing data through field links. Data remains live, so that when the source is changed the linked field or fields change also. Mail Merge is the most obvious example of field level integration.

3.	Embedding and linking documents (see Object embedding) – whole documents, or a selected part of a document, can be inserted into another application. For example:

•	Include spreadsheets and charts in Write

•	Include drawings in Write and Spreadsheet

•	Include Write documents in Spreadsheet

There is a special link function called Hyperlink that allows documents to refer to other documents (or web pages) and provide a clickable jump to load that document. See the hyperlink function for more details.

See also:

Fields - an introduction

Mail merge


Copy and paste

In general, you can select any text, data or formulas and make a copy for insertion into another – or the same – document. Ability has commands that enable you to Copy, Paste and Cut data. If you want to copy data to another location without retaining the original source data, then use Cut instead of Copy. Here are the basic steps:

1.	Select the data you wish to copy, using either the mouse or cursor keys. This might be the contents of an individual cell or range in a spreadsheet or database, whether text, data or formulas, or an area of a Write document.

2.	Click on the Copy button [image] or select Copy from the Edit menu. This command copies to the Clipboard.

3.	Switch to the application that contains the document to which you wish to copy.

4.	Click on the Paste button [image] or select the Paste command from the Edit menu. This copies from the Clipboard to the target document.

Once the Paste command has been issued, there is no further link between the copied data in the target document and the contents of the clipboard or the source of the data. It is as if you have retyped the data, but much quicker. The contents of the clipboard remain unchanged until you copy some other data to it.

Most of the Ability applications –Write, Database, Spreadsheet – support rows and columns. When you copy data from one application to another, the rows and columns are preserved. This is obvious with Database and Spreadsheet, which are defined in term of fields and cells, but less so with Write, in which a row is represented by a paragraph and a column by a tab stop. For example,

Jan	Feb	Mar	Apr
12	13	9	7
has four columns (since the months and numbers are each separated by pressing the Tab key) and two rows.

See also:

Examples of copy and paste

Copy and paste in dialogs


Examples of copy and paste

Here are some examples of what you can do with Copy and Paste:

•	Database · Spreadsheet

Select the rows and columns (the range of fields) you want to copy from the database and copy and paste into a spreadsheet. Ability will preserve the order of the rows and columns and every field from the database will appear in a different spreadsheet cell.

•	Database · Write

Select the rows and columns (the range of fields) you want to copy from the database, and copy and paste into a Write document. Each column is separated by a tab stop and each row begins on a new line.

If the database row is too long to fit on a single line in the Write document and "wraps around" onto the next line, try bringing the tab stops closer together and/or reducing the font size.

•	Write, Spreadsheet · Database

This is the reverse of the above two operations. Ideally the number of columns in Spreadsheet – or the number of tab separated columns in Write – should match the number of fields (columns) in your database (if not, you may find that fields from different records merge into a single record).

•	Write · Spreadsheet

Select the text you wish to copy. This can be a word, a line or several paragraphs. When you paste into Spreadsheet, tabs will begin new columns and paragraphs new rows. Use Paste Special from the Edit menu and select Unformatted Text.

See also:

Copy and paste in dialogs


Copy and paste in dialogs

As well as using copy and paste to transfer data between applications, you can copy and paste into dialog boxes and formula entry lines. You will need to make use of the shortcut keys to do this:

Ctrl+C	Copy

Ctrl+V	Paste

For example, in the text of a Write document, there appears the name of another document - a spreadsheet called Figures, say. To copy and reuse the word "Figures":

1.	Select it by double-clicking on it.

2.	Press Ctrl+C to copy it.

3.	Switch to Spreadsheet.

4.	Click the Open button [image].

5.	Press Ctrl+V to paste it into the File name box.


Linking through fields

One of the most powerful features of Ability is the capacity for a field in one document or application to refer to a field in any other Ability document or application. Such a relationship is called linking and can take two forms: one-way linking and two-way linking:

1.	A one-way link (see One-way links) is used to access data that is located in another document, from the current document. The data can be displayed or used in a formula, but cannot be changed unless you open the original document. A one way link can be made between documents in different applications.

2.	A two-way link (see Two-way links) allows you to change data at either end of the link. This means that the original document is updateable from the target document, though two-way links cannot be used in formulas.

Linking can be used to connect these documents:

•	Cells in a spreadsheet to another spreadsheet, write document or database form.

•	Fields in a database to a spreadsheet or write document.

•	Fields in a write document to another write document, spreadsheet or database form.

For a general discussion on fields, see Fields - an introduction.

Links can also be set up between cells in the same spreadsheet or fields in the same Write or database document (see One-way links in a spreadsheet and Two-way links in a spreadsheet).


One way links
One-way links

To create a one-way link, you need to know the name and the location of the document to which you want to link. With a Write document or spreadsheet you need to know the name of the field or cell address whose value you want to access. If you want to link to a database you also need to know the table or query name, along with the field name and record number.

The link is created using one of the Remote functions. The remote functions you will most often need are:

WPGET(document_name, reference)	Retrieve field from Write
SSGET(document_name, reference)	Retrieve field from Spreadsheet
DBGET(database_name, source_table, field_name, record)	Retrieve field from Database
When you enter a remote function in a field in the current document, you need to specify the following:

1.	Name and path of the remote document or database (otherwise the current folder will be searched).

2.	Name of the field, in the remote document, whose value is sought.

3.	When linking to a database, you will additionally need to supply the table name, field name and record number.

As well as returning single values, all field links can be used to return ranges, which can then be used to provide range totals, maximums, minimums, and so on.

The following examples should be studied. Also, for more on Remote functions, see Remote functions.

See:

Linking two spreadsheets together

Linking two Write documents togther

Linking from a Write document to a spreadsheet

Linking from a spreadsheet to a database


Linking to spreadsheet example
Linking two spreadsheets together

To create a one-way link from a spreadsheet called accounts to a cell, say B10, in a spreadsheet called sales, follow these steps:

1.	Select a cell in accounts where you'd like the value from sales to appear, say A1.

2.	Click in the formula entry line.

3.	Click on the Insert Function button [image] to bring up the “Insert Function” dialog.

4.	Click on the Remote tab and scroll through to select the SSGET function.

5.	Select OK to pick the function.

6.	Enter the function parameters so that the formula appears as follows:

=SSGET ("sales", "B10").

7.	Click [image] to finish the formula.

Ability will display the value from the sales spreadsheet inside the accounts spreadsheet.

Once the link has been made, the cell can be referenced like any other. For example, the formula

=A1 * 2

anywhere in the accounts spreadsheet will simply display the value from A1, originally from sales, doubled.

You can also use the SSGET function directly as part of a formula. For example:

=(10 + SSGET("sales", "B10"))/2

Note that the function parameters must be placed in quotation marks. Also, the example assumes that the two spreadsheet documents are in the same folder. If they are not, then you must specify the full document path. For example,

=SSGET("c:\my documents\sales", "B10")

if sales is stored in the default document folder.

Any change made to B10 in sales will automatically be reflected in A1 of accounts. However, since this is a one-way link, the attempt to enter a value in A1 of sales will overwrite the link formula and hence destroy the link (see Two-way links to find out how to set up two-way links).


Linking to a write document example
Linking two Write documents together

To create a one-way link between a field, say janprofits, in a Write document called report, and a field, say monthtotal, in a Write document called annuals, where the link is from report to annuals, follow these steps:

1.	You first need to create a field in report. Select Field from the Insert menu. Enter janprofits for the field name (which is obviously more descriptive than the default name of Field1), click the Next button, and enter 1276.34 as the field contents in the Formula entry line. Click the Finish button.

2.	Switch to annuals and click where you want the field to appear. Select Field from the Insert menu. Enter monthtotal for the field name and click the Next button. Click the Functions button and select WPGET from the Remote function category. Enter the document name and field name into the function, so that the formula appears as follows:

=WPGET("report", "janprofits")

Click the Finish button.

3.	The field will appear in the document. Click outside the field to activate the one-way link. The value from the report document, 1276.34, will appear in the document.

Note that the example assumes that the two documents are in the same folder. If they are not, use the full document path of the source document. For example,

=WPGET("c:\my documents\report", "janprofits").


Linking from a Write document to a spreadsheet

Suppose you have a sales spreadsheet with monthly sales figures. You want to include the highest monthly figure and the total sales for the year in a Write document. The spreadsheet is called sales97 and the figures you will need run from C1 to C12. The figures need to appear in the middle of a paragraph like this:

"The average monthly sales for 1997 was $xxxx.xx with the highest single month topping out at $xxxx.xx."

Follow these steps to link from the Write document and extract these figures:

1.	In the Write document, type the text of the paragraph. Leave a space where the fields need to be inserted.

2.	Position the cursor between the words "was" and "with".

3.	Select Field from the Insert menu.

4.	Click the Next button (if you want you can enter a more meaningful field name on the first page of the wizard).

5.	Enter the following formula:

=AVG(SSGET("sales97", "C1..C12"))

6.	Click Finish.

7.	Position the cursor at the end of the paragraph and repeat steps 3 through 6, using the following formula:

=MAX(SSGET("sales97", "C1..C12))

Note that the example assumes that the two documents are in the same folder. If they are not, use the full document path of the source document. For example,

=MAX(SSGET("c:\my documents\sales97", "C1..C12"))


Linking from a spreadsheet to a database

Suppose you have a database called accounts, containing a table called invoices. Among other fields in the database table, there is a field for the total of the invoice, invtotal, one to identify the customer, custid, and two more for the date of the invoice and the date it was paid, invdate and paydate. The particular customer you are interested in has a custid entry of 1024. In a spreadsheet, you want to analyze his payment history, perhaps plotting a graph to show the payment trend. Follow these steps:

1.	Display the first invoice total: Enter the following formula:

=DBSQLFILTER("accounts.adb", "invoices", "custid=1024", "invtotal", 1)

Let’s explain this in some detail. The first two parameters to this function are simply the database name and the table name – note you need to include the document extension with the database name (adb). The table contains invoices to many customers, so you have to identify which customer you want to return values for. This is done with the third parameter to the function – "custid=1024". Next, we specify which field is to be returned with the third parameter – invtotal. The function actually returns all the fields matching the condition, so we need to say which one is to be displayed. The final parameter says "display record 1".

2.	Display the invoice and payment dates. In the cells to the right of the invoice total, enter the following two functions:

=DBSQLFILTER("accounts.adb", "invoices", "custid=1024", "invdate", 1)
=DBSQLFILTER("accounts.adb", "invoices", "custid=1024", "paydate", 1)

3.	Repeat steps 1 and 2 for the rows below, incrementing the record number (the fifth parameter) by one each time, until all the matching invoices are displayed.

4.	You can now analyze the data in several ways. Here are two examples:

Produce an average payment period by subtracting the invdate column from the paydate column and dividing by the number of invoices.

Plot a bar chart of the number of days it takes to pay each invoice (again by first subtracting the invdate column from the paydate column).

There are a number of ways this example can be improved and made more general (so it will work easily for other customers).

See:

Refining database links.


Refining database links

The Database is ideal for storing information, but Spreadsheet is the best place to perform calculations. Using the database links, you can combine these tools in an efficient and powerful way. For an example of how to make links to database, see Linking from a spreadsheet to a database. The notes below show how the example can be refined.

1.	The number of matching records can be calculated in advance, using the following formula:

=ROWS(DBSQLFILTER("accounts.adb", "invoices", "custid=1024", "invtotal"))

2.	If there are many matching invoices, the ROW function can be used to propagate the formula. For example, supposing record one was entered in row 10, you could use the following:

=DBSQLFILTER("accounts.adb", "invoices", "custid=1024", "invtotal", ROW()-9)

When this cell is copied down the spreadsheet, the appropriate record is displayed.

3.	It could be more efficient if some of the parameters are entered separately in spreadsheet cells. For example, cells A1 through A5 could contain the following text/formulae:

Once A5 is copied down and across (with the correct field names), you can enter a new customer ID in cell A3 and analyze a different customer.

4.	Taking step 3 a bit further, you could insert a mail merge field that will step through each customer and so print out a "payment history". To do this follow these steps:

a)	Select Field from the Insert menu.

b)	Enter custfield as the field name. This is actually the name of the new field, not the database field to be linked to, so you can choose any name you like.

c)	Select the Database radio button and then click Next.

d)	Make the link: pick the accounts database, the invoice table and the custid field and click Finish.

e)	Substitute the following formula for cell A4 (in step 3 above):

=SSGET("spread1", "custfield")

where spread1 is the name of the current spreadsheet and custfield is the new field.

f)	Select the Mail Merge button [image] or the Mail Merge button from the Tools menu.

g)	Select Print to finish the mail merge.


Using one-way links in formulas

One-way (but not two-way) links can be used as part of a standard formula. In addition, because the link functions can return ranges as well as individual cells, you can apply any function that has a range as a parameter directly to the link. For example, using the following spreadsheet called quarter:

When building a formula in another spreadsheet or a field in a Write document, treat the link function like any other. For example:

=10+SSGET("Quarter", "B3") / 2

To count the number of records, and to find the total, average and maximum volume, refer to the range and use these built-in functions:

=ROWS(SSGET("Quarter", "B2..B5"))
=TOTAL(SSGET("Quarter", "B2..B5"))
=AVERAGE(SSGET("Quarter", "B2..B5"))
=MAX(SSGET("Quarter", "B2..B5"))

The same ideas can be applied to a database table. Consider the following invoice table in an accounts database:

The table information can be referred to in the following ways:

=10+DBGET("accounts.adb", "invoices", "invtotal", 3) / 2

to re-use the invoice total field from row 3 (that is the value 8.50) in a formula; and

=ROWS(DBGET("accounts.adb", "invoices", "invtotal"))
=TOTAL(DBGET("accounts.adb", "invoices", "invtotal"))
=AVERAGE(DBGET("accounts.adb", "invoices", "invtotal"))
=MAX(DBGET("accounts.adb", "invoices", "invtotal"))

to find the number of records, and the total, average and maximum of the invoice totals.


Two way links
Two-way links

A two-way link is a connection between the current field and a field in another – or the same – document. If you change the value of either field, the value in the other field will also change.

A two-way link cannot be used as part of a formula, unlike a one way-link (see Using one-way links in formulas). Apart from this, you build two-links in the same way as one-way links, as follows:

1.	Create a normal one-way link (see One-way links for more details).

2.	Turn the edit source property on:

•	In a spreadsheet, use the Edit Source button [image] or select the Edit Source property in the Format/Attributes dialog.

•	In a Write document, double-click on the field, select Attributes from the Field menu and select the Edit Source property.

For example, consider the following database table, called invoices:

1.	In a spreadsheet cell, enter the following formula:

=DBGET("accounts.adb", "invoices", "invtotal", 3)

2.	The result of the formula - 8.5 - is displayed.

3.	Click on the Edit Source button.

4.	You can now enter a new value in the cell, and the database will be updated.


Linking and embedding documents

On some occasions, you may find you need to insert a chart or part of a spreadsheet (or both) into a report you are creating in Write. It could be that you want to create a new spreadsheet that will only exist within the current document, or you may want to insert a spreadsheet that you've already created. Further, you may want the document to automatically update should the original spreadsheet change.

These are all examples of a standard Windows technique called Object Linking and Embedding (or OLE for short), which Ability uses to enable such documents to be created. In this case, the Object is the spreadsheet, Embedding refers to the inclusion of an object within the current document (as in the first two examples above), and Linking refers to the "live" display of external data (as in the final example above).

All the Ability applications support OLE to some extent, as do many other non-Ability applications (meaning that Ability can share data with other applications).

Here’s a list of what can be inserted and where:

Application	Include objects from
Write	Spreadsheet (including charts), Draw, and any external applications that support OLE
Spreadsheet	Write, Draw, and any external applications that support OLE
Database OLE field	Spreadsheet (including charts), Write, Draw, and any external applications that support OLE
Draw (and Database forms)	Spreadsheet, Chart, Write, and any external applications that support OLE
External programs (non -Ability applications supporting OLE).	Write, Spreadsheet, Chart, and Draw.
The following sections tell you all about object linking and embedding, as well as giving some examples.

See:

Object linking

Object embedding

For examples of how this can be put into practice (it's much easier to do than the terminology might suggest), see one of the following:

Inserting a spreadsheet into a Write document

Inserting a chart into a Write document

Inserting a Draw document into Write or Spreadsheet

Inserting an image into Write or Speadsheet


Object linking

When an object is linked, the source data continues to reside physically wherever it was initially created. Only a reference, or link, to the object is kept with the compound document (along with appropriate presentation data). Linked objects cannot "travel" with documents to another machine; they must remain within the local file system or be copied explicitly.

Linking is efficient and keeps the size of the compound document small.

You may choose to link when the source object is owned or maintained by someone else, so that a single instance of the object’s data can serve many documents.

Changes made to the source object are automatically reflected in any compound documents that have a link to the object.

To link an object:

1.	Select Object from the Insert menu.

2.	Select the Create from File radio button.

3.	Make sure the Link box is checked.

4.	Select the Browse button to locate the source object (for example, if you are embedding an Ability spreadsheet, you should be looking for a document with an AWS extension).

5.	Select OK to insert and link the object.

See also:

Object embedding

Linking and embedding documents


Object embedding

When an object is embedded, a copy of the original object is stored physically in the compound document, along with all the information needed to manage the object. As a result, the object becomes a physical part of the document. A compound document containing embedded objects will be larger than one containing the same objects as links.

However, embedding offers several advantages that may outweigh the disadvantages of the extra storage overhead. For example, new objects can be inserted as needed, and compound documents with embedded objects may be transferred to another computer and edited there.

To embed an object, select Object from the Insert menu and do one of the following:

•	Create and embed a new object

1.	Select the Create New radio button.

2.	Select the object type – this can be Ability Spreadsheet, Write or Draw, or an object from any other listed application.

3.	Click OK to embed the new object.

•	Embed an existing object

1.	Select the Create from File radio button.

2.	Make sure the Link checkbox is clear.

3.	Select the Browse button to locate the source object (for example, if you are embedding an Ability spreadsheet, you should be looking for a document with an AWS extension).

4.	Click OK to embed the object.

See also:

Object linking

Linking and embedding documents


Inserting a spreadsheet into a Write document

To insert a spreadsheet into a Write document, position the cursor in the Write document at the point where you want the spreadsheet to go and do one of the following:

•	Insert a new spreadsheet

Select Spreadsheet/Chart and then New from the Insert menu. A standard spreadsheet will appear, ready for entering data.

•	Insert an existing spreadsheet

1.	Select Spreadsheet/Chart and then From File from the Insert menu.

2.	Browse to the spreadsheet you want to insert.

Once the spreadsheet, whether new or old, has been inserted, you can display a selected part of the spreadsheet or a certain area of rows and columns. In edit and display mode, you can use the zoom buttons to make the cells − and hence the data within them − display larger or smaller. In scaling mode, you can scale the spreadsheet to fit more neatly into your Write document.

•	On the standard spreadsheet view, that is in edit mode, use the handles to resize the spreadsheet and the scroll arrows to bring the relevant part of the spreadsheet into view. In this way you can determine the rows and columns that will be displayed and/or a particular cell or group of adjacent cells. Use the zoom buttons on the toolbar, Zoom in [image] and Zoom out [image], to increase or decrease the size of the spreadsheet cells and their data. Note that the inserted spreadsheet object (or view) will itself remain the same size until you use the handles to resize it, so you may need to resize in conjunction with zooming.

•	Click once outside the spreadsheet to go to display mode. The spreadsheet will retain the form you set for it in edit mode, that is the same rows and columns or group of cells will be displayed. In this mode you can’t edit the data or resize the spreadsheet, and the row and column bars are not visible. You can however use the zoom buttons to increase or decrease the size of the displayed cells and their data.

•	Click once again inside the spreadsheet to go to scaling mode. The spreadsheet is displayed with its handles visible. Use the mouse to drag these handles and hence resize the rows and columns. Dragging horizontally only will increase/decrease the column width for all the columns. Dragging vertically only will increase/decrease the row height for all the rows. Dragging diagonally, using the handle at the bottom right corner, will increase/decrease both the column width and row height for all rows and columns.

•	Double-click inside the spreadsheet to return to the standard spreadsheet view (edit mode).

•	Note that when printing a Write document with an inserted spreadsheet, the spreadsheet object is printed without the row and column bars, that is to say, it is printed as if it is in display mode, even if the current screen view happens to show the spreadsheet in edit mode.

If you wish to insert a chart, based on a spreadsheet, into a Write document, see Inserting a chart into Write for more information.

See also:

Linking and embedding documents


Inserting a chart into Write

Since a chart is always attached to a spreadsheet, you insert a chart into a Write document by first inserting the spreadsheet and then selecting or creating the chart to display (see Inserting a spreadsheet into a Write document for details on how to insert the spreadsheet).

Immediately after insertion the spreadsheet will be in edit mode. This means you can make changes to the spreadsheet rather than the document. If you drop out of edit mode (by clicking in another part of the document, for example), double-click on the spreadsheet again to make it active.

The next step depends on whether you're creating a new chart or displaying an existing chart, as follows:

•	Creating a new chart

Select the figures you want to chart (or type them in if it's a new spreadsheet). Select As New View from the Insert / Chart menu. Follow the steps in the chart wizard to create the appearance you want. See Chart for more details on how to create charts.

•	Displaying an existing chart

Once a spreadsheet has been inserted, you can choose which view you'd like to show in the document. Select Sheet from the View menu to display the normal spreadsheet grid. Select Chart from the View menu to view the chart. If there is more than one chart, you will be prompted to make a selection.

See also:

Linking and embedding documents


Inserting a Draw document into Write or Spreadsheet

To insert a Draw document into a Write document or spreadsheet, position the cursor at the point where you want the Draw document to appear and do one of the following:

•	Insert a new draw document

Select Picture/New Ability Drawing from the Insert menu. A standard draw document will appear, ready for creating a new drawing – see Draw for more details on how to create a drawing.

•	Insert an existing draw document

1.	Select Picture/From File from the Insert menu.

2.	Click on the Browse button to choose the draw document.

See also:

Linking and embedding documents


Inserting an image into Write or Speadsheet
Inserting an image into Write or Spreadsheet

An image (or picture) can be inserted directly into a Write document or spreadsheet.

An image is a file in one of the following formats:

BMP	Windows Bitmap
WMF	Windows Meta File
DIB	Device Independent Bitmap
TIF	Tagged Image File Format
GIF	CompuServe™
TGA	Targa
PCX	PC Paintbrush™
JPG	Jpeg
Inserting the picture:

1.	Select Picture/From File from the Insert menu.

2.	Double-click on the image you want (or first browse to the folder where the image resides, if necessary).

3.	Once inserted, you can scale the image to the size you need by dragging the picture's handles.

Note: both Spreadsheet and Write support the pasting of images via the clipboard.

See also:

Linking and embedding documents


Fields - an introduction
Fields – an introduction

Fields are common throughout Ability. The most obvious example of a field is a cell in a spreadsheet – it can contain plain text, numbers or dates, or it can display the result of a formula. The same is true of formula fields in Write documents and Database forms and reports.

Fields share common properties – fonts, borders, colors, numeric formatting, alignment – throughout the Ability applications.

There are other properties that depend on the particular type of field. For example, a mail-merge field in Write (also called a database field elsewhere in Ability) allows database information to be browsed and merge printed in Write, Spreadsheet and Database. To do this it accesses a source database, table and field. See Inserting fields.

Another powerful property of fields is their ability to refer to, or link to, fields in other documents and applications – see Linking through fields.

Here are some examples of fields:

Application	Description	Created through
Write	Date and time field	Insert/Date and Time
	Mail merge field	Insert/Mail Merge Field
	Formula field	Insert/Field – this is the standard field, which can be used for formulas and links
	Database field	Insert/Field – this field allows you to browse or change data held in a database table
Spreadsheet	Cells	Standard spreadsheet cells – always present
	Floating field i.e. a database or formula field that can be dragged and dropped anywhere in spreadsheet. You can mail merge or browse database information, or separately store information in addition to the standard spreadsheet cell, as well as show the results of formulas	Insert/Field – select either the Formula or Database field type in the field wizard.
Database	Formula field in forms and reports – equivalent to a standard field in Write.	Insert/Formula Field when in design mode in forms or reports.
	Lookup Summary field – joins the current table to another table to provide summary information.	Insert/Lookup Summary Field – available in both forms and report design mode.
	Database field – browse information from another database table	Insert/Database Field – available in design mode in forms and reports
	Date and Time Page Number	Insert/Date and Time Insert/Page Number –  available in design mode in forms and reports


Inserting fields

Wherever you are working in Ability, whether in Write, Spreadsheet or Database, you will often find it useful to insert fields. Various types of field are available and some of them are common to all the applications. Among the options there are fields for date and time, page number, formulas, mail merges, database lookup, linking, and others. Moreover, when inserting fields you can also control their appearance and content and how they will be editable, using the various format and control type options (see Control types).

See:

Inserting a date and time field

Inserting a page number field

Inserting formula and database fields


Inserting a date and time field

You can insert a date and time field in Write, Spreadsheet, and Database.

In Write, follow these steps:

1.	Place the cursor where you want the field to appear

2.	Select the Date and Time command from the Insert menu

3.	In the “Date and Time” dialog select a date and/or a time format

4.	If you want to insert both the date and time, click on the Date + Time checkbox

5.	If you want the day of the week to appear, click on the Include Day of Week checkbox – click again to get the intermediate state e.g. Tue instead of Tuesday

6.	Leave the Update Automatically box checked if you want the date and time to update automatically (a “live” field will be inserted), otherwise uncheck it if you just want to insert the current date and time (this will be inserted as text rather than as a field)

7.	Click on OK

In Spreadsheet, follow these steps:

1.	To insert a date and time into the body of the spreadsheet you can use the standard Ability functions, NOW and TODAY (see Date functions).

2.	To insert the date and time into a header or footer, see Headers and footers for more information.

In Database, you can insert the date and time into either a form or a report − see Inserting the date and time into a form or report.


Inserting a page number field

You can insert a page number field in Write, Spreadsheet, and Database.

•	In Write, see Inserting page numbers.

•	In Database, see Inserting a page number into a form or report.

•	In Spreadsheet, see Adding a header and footer.


Inserting formula and database fields

You can insert formula and database fields in Write, Spreadsheet and Database.

•	In Write, see Inserting a field.

•	In Spreadsheet and Database see Inserting formula fields and Inserting database fields.


Control types

When you create formula and database fields in Write, Spreadsheet and Database, you can also decide how you want the fields to be editable. This is done through the control type that you set for the field. There are six standard control types:

•	Edit box (see Edit box control type)

•	Check box (see Check box control type)

•	List box (see List box control type)

•	Combo box (see Combo box control type)

•	Spin edit (see Spin edit control type)

•	Radio group (see Radio group control type)

These can be used with formula and database fields in all the applications.

After you have set the control type for your field, and hence how the field will be editable, you can, if you want, set options for how the field will operate. There are four choices:

•	The Edit Source option allows you to change data from either side of a two-way link.

•	The Hide Zeros option allows you to hide any zeros, displaying a blank field instead.

•	The Hide Errors option allows you to hide any error messages, displaying a blank field instead.

•	The Show as control if inactive option allows you to show the control type itself, even when the field is not currently selected (“inactive”).


Edit box control type

The Edit box control type allows you to enter any data you like. For instance, if you have created a Formula field that contains a formula, you can edit it so that it applies to new data, or change the formula to another one, or replace the formula with any other data or none at all (this can be done in the formula entry box).

See:

Control types


Check box control type

The Check box control type allows you to insert a box that can be checked on or off so that the field shows True (Yes or 1) or False (No or 0). Typically you use this control type when you insert a blank formula field into your document and you want to use it to indicate that some other field has or has not a certain value. Alternatively you may insert a database field, say of customer names from a database table, and want to indicate that you will contact them over the next month (e.g. when checked the check box displays Yes) or not (e.g. when unchecked the check box displays No).

In addition to the True, Yes, 1 and False, No, 0 values, there are also available @Empty and @Not Empty. Set these in the Checked and Unchecked boxes (selecting the type of check in one of these will automatically select the opposite check in the other) after selecting the Check box control type. You should then type in the display value in the Display choices box.

For example, if you want to insert a blank field with check box control type into your document, so that it will display True when checked and False when unchecked, follow these steps:

1.	Select Field from the Insert menu to go into the “Insert Field Wizard”

2.	Select Formula in the Field Type box

3.	Leave the Formula box empty

4.	Select Checkbox in the Control Type box

5.	Click on the arrow to select True,Yes,1 in the Checked box (the Unchecked box will automatically show False,No,0)

6.	Type in the Display choices:

•	True in the Checked line

•	False in the Unchecked line

7.	Click on Finish to return to your document

To activate the inserted field, double-click on it. You are now free to switch the check box on or off by clicking on it. Click once outside the field to show the display value i.e. True if the check box is switched on.

See:

Control types


List box control type

The List box control type allows you to choose from a pre-defined list that you have typed in or from the entries in an already existing database field. When you attempt to enter data in the box in your document, it will only accept data that is in the list you typed or in the field that you selected, otherwise it will display the first entry in the list if you try to enter invalid data. The List box is useful if you want to restrict the data displayed to a pre-set selection. If you sometimes want the option to enter data that is not in a pre-set list, then it is better to use the Combo box i.e. combination box, control type.

Example

1.	When inserting a formula field you can set the Control Type at List box.

2.	On the next page of the “Insert Field Wizard”, select Use Choices in the Control Source box, and then type your list choices (one per line) in the Choices box.

3.	Alternatively, if you click on Lookup Choices you can use a pre-set list contained in a database field.

See:

Control types


Combo box control type

The Combo box control type allows you to choose from a pre-defined list or from a selected database field and to type in entries that are not chosen from either of these. In this respect it is more versatile than the List box control type, which only allows entries from a pre-defined list or database field.

Example

1.	When inserting a formula field you can set the Control Type at Combo box.

2.	On the next page of the “Insert Field Wizard” select Use Choices in the Control Source box, and then type your list choices (one per line) in the Choices box.

3.	Alternatively, if you click on Lookup Choices you can use a pre-set list contained in a database field.

Once the field is inserted into your document, you can choose from the pre-set choices or entries in a database field, or type in new entries which do not occur in the list.

See:

Control types


Spin edit control type

The Spin edit control type allows you to scroll up and down through a list of numeric values, where these values are usually held in a particular database field. Alternatively you can use your own choices, rather than look up pre-existing choices. Using the arrows on the right side of the inserted field, with spin edit control type, you can select the values you want displayed for each of the records in your database table. You would do this in either forms or reports.

See:

Control types


Radio group control type

The Radio group control type allows you to select an option from several that you have set yourself, by clicking on a particular radio box. The radio boxes are mutually exclusive, so selecting one will turn off any other that is already selected. In this way you are able to determine the contents of a field, from a restricted number of choices, in one easy click of your mouse.

Once you have selected the Radio group option, you should select Use Choices in the Control Source box of the Group page. You can then enter your group choices in the Choices box (one per line). Each of these will be displayed to the right of its own radio group box in your document.

Example

You want to insert a database field into a form so that you can choose which entry, from a group of entries, will appear for each record in a particular field.

1.	When in Design mode, select Database Field from the Insert menu.

2.	In the “Insert Field Wizard”, select a field from the database table in the Data field box. This is the field that will contain whatever you choose from the radio group choices.

3.	On the next page select Radio group.

4.	Finally, select Use Choices and type in the names that are to form the radio group in the Choices box, making sure that each choice occurs on its own line.

5.	Select Finish and use the mouse to adjust the size of the field box before returning to Browse mode.

As you browse through the records in your form, you can click on one of the radio group choices to insert it into the field you selected from the underlying table. Obviously you can insert different values for different records. If there is already a value in the field for a particular record, it will be replaced by any radio group value you decide to choose.

Note that if you intend to insert a radio group database field later on, it is a good idea to design a table with this in mind. More often than not the field should be set as a character field, in order to make sure that your radio group choices are of compatible data type.

See:

Control types