This section describes how to create export programs with Report Writer. An export program can be used to transfer data from an application database table to an ASCII file, or used to generate an Import program automatically.
Start REPSETUP. You can start it from the DP4 main menu like this:
Enter the database name.
On the Edit menu, select the Automatic program generation option.
On the Automatic Report Program Generation screen, enter Export
as the program type to generate.

For export programs, the other fields of importance are:
Disable this option if you want to select the tables containing data to export
Specify the length, in characters, that you want every line in the export file to be. (Lines may be shorter than this if you choose to remove trailing spaces in the Output Devices screen). 0 is often entered and prints lines up to the last character that is not blank.
By default, the maximum line length possible is 500 characters. If you have tables that are wider than this, the options are:
This facility is only available from 4.523/4.619 onwards. Use the -maxwidth width commmand line option when you start REPSETUP, to increase the limit to a higher value (the maximum allowed is 9999), and specify that your program uses a print device with a suitably high page width. . The System database includes a print device named DP4_Export, which is set to allow a page width of 5000 characters, (you can change this using the Printer charactersitcs option of DFSETUP if required).
Reduce the number of fields to be exported by amending the export program after generating it (see Field Processing) in the Report Writer Developer's Manual.
Define a printer on your system database with a zero length string for Carriage Return. Then a folded report will end up lines joined together. You will need to use a formula to insert an explicit line feed after the last field (e.g. CHR(13)+CHR(10)).
Use multiple linetypes and export the keyfields and a tag on each line. The DP4 Importer is able to import a file in this format.
Use the Data Unload and Load facility to transfer the data.
The Automatic Program Generator automatically generates report programs for exporting data in a standard format from the specified tables.
Once you have created all the export programs you need, press <Esc> to return to the Edit menu.
You now have a choice of actions:
| Change | Method |
|---|---|
| Change the delimiter character. | Select option 1 - Table details and type. Edit the Field delimiter. |
| Make the fields variable-width rather than fixed-width. | Select option 6 - Output devices and format. Enable Remove Trailing trailing blanks |
| Change the condition to include a record. |
Select option 4 - List/delete condition. Edit the condition. |
Save your changes and select Exit from the menu bar of the REPSETUP screen.