Saving data in an external file

While previewing, you can save the data retrieved in an external file. Note that the data and headers (if specified) are saved. Information in the footer or summary bands is not saved unless you are saving as PDF or as a PSR file.

StepsTo save the data in a DataWindow object in an external file:

  1. Select File>Save Rows As from the menu bar.

    The Save As dialog box displays.

  2. Choose a format for the file from the Save As Type drop-down list.

    If you want the column headers saved in the file, select a file format that includes headers (such as Excel With Headers). When you select a with headers format, the names of the database columns (not the column labels) are also saved in the file.

    When you choose a format, PowerBuilder supplies the appropriate file extension.

  3. For TEXT, CSV, SQL, HTML, and DIF formats, select an encoding for the file.

    You can select ANSI/DBCS, Unicode LE (Little-Endian), Unicode BE (Big-Endian), or UTF8.

  4. Name the file and click Save.

    PowerBuilder saves all displayed rows in the file; all columns in the displayed rows are saved. Filtered rows are not saved.

The rest of this section provides more information about saving data in PDF, HTML, and PSR formats.

For more information about saving data as XML, see Chapter 29, “Exporting and Importing XML Data.”