Fundamentals of Exporting Data

 <  Day Day Up  >  

Some general rules apply when exporting data out of FileMaker Pro and FileMaker Developer.

The active window controls the export process because the active window displays a specific layout, and that layout is based on a specific table occurrence, and that table occurrence is based on a specific table. In the simplest type of export where no related fields are included in the export, the data comes from that specific table. It's a key concept in FileMaker Pro 7: The active window determines the table for export. The active window controls other aspects of exporting as well, but those will be considered in the next section. For now, we consider the simplest type of export.

The number of records that you can export is controlled by the found set in the window that's active at the time of the export. If you have 500 records in your Customer table, but the currently active Customer layout is showing only a found set of 33, then you'll be able to export data from only those 33 records. If you want to export all your Customer records, you need to select R ecords, Sho w All Records first. If the found set of records has a sort order, that order is preserved in the export process.

The simplest type of export is one in which you export the contents of a single FileMaker table. After you have a found set containing the records you want to export, the export process itself is very simple to perform as long as your access privileges permit exporting.

For more on how privilege sets are used to control a users ability to export, see Chapter 12, "Implementing Security," p. 315 .


Choose F ile, E xport Records to bring up the Export Records to File dialog. Enter a file name , then click on the Save as Type pop-up list on the bottom of the dialog box and note the various formats that are available, as shown in Figure 20.1.

Figure 20.1. FileMaker Pro can export data to a variety of formats.
graphics/20fig01.gif

Typically, the format that you use is determined by the application into which you need to import the data. When in doubt, it's hard to go wrong with tab- or comma-separated text files.

After you enter a file name, select a format, and click Save, the Specify Field Order for Export dialog comes up, as shown in Figure 20.2.

Figure 20.2. Most export formats don't allow the inclusion of a container field in the export order.
graphics/20fig02.gif

The list on the left side of the dialog contains fields that are available for export. Although it's possible to export related fields, just consider the fields in the current table (determined by the active window) for now. Double-clicking a field or selecting a field and then clicking Move causes that field to move into the Field Export Order. Fields in the Field Export Order will be included in the export. This mechanism enables you to include or exclude certain pieces of data if you so desire .

NOTE

It's important to realize that only the FileMaker export format supports the exporting of data that's contained in container fields. An export using any other export file format does not allow you to move container fields into the Field Export Order.


Container fields can't be included in most export file formats. If you're not exporting to the FileMaker format, you need to use a script containing the Export Field Contents script step, or the Export Field Contents menu command to export the contents of a container field.

Note that the fields listed in the Field Export Order have double-headed arrows in front of each line. Clicking and dragging those arrows enables you to re-order the Field Export Order. If the field order is at all critical in your exported file, this mechanism enables you to set the order according to your requirements.

The Group By option is available only if you sort the database prior to exporting your data. This option is investigated in more detail later in the chapter. The Options box at the bottom of the dialog enables you to set the character set of the exported file. The option to Apply Current Layout's Data Formatting to Exported Data is covered in the next section.

After you have the Field Export Order set the way you want, click Export to create the export file.

 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net