Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: How To (Forms, Reports, and more) > Reports and Labels > Technical Documents

Printing Report as Text File

Scroll Prev Top Next More

R:BASE supports the following Report Output Options:

 

Screen

Printer

Adobe Acrobat Document (.PDF)

Bitmap File (.BMP)

Enhanced Metafile (.EMF)

Excel Document (.XLS)

GIF Image File (.GIF)

HTML Document (.HTM)

JPEG Image File (.JPG)

Report Emulation Text File (.TXT)

RTF Document (.RTF)

Text File (.TXT)

TIFF Image File (.TIF)

Windows Metafile (.WMF)

 

As you can see by the file type and their extensions, the "Report Emulation Text File" and "Text File" both have the same .TXT extensions. So, what is the difference between Report Emulation Text File and Text File?

 

The "Report Emulation Text File" allows you to print the exact report as plain readable text including all bands, such as Report Header, Page Header, Break Headers, Break Footers, Page Footers and Report Footers, if any. On the other hand, the "Text File" allows you to define a particular band to print the data as Comma Delimited, Tab Delimited or Fixed Length file. This is the perfect option to export selective and/or summarized data used in a report band.

 

Syntax to PRINT the report as Report Emulation Text File:

 

 PRINT reportname OPTION ETXT|FILENAME filename.txt|OPEN ON

 

 Example:

 

 CONNECT ConComp        

 PRINT ColumnarReport OPTION ETXT|FILENAME ColumnarReport.TXT|OPEN ON

 

Syntax to PRINT the report as Text File:

 

 PRINT reportname OPTION TXT|FILENAME filename.txt|OPEN ON

 

 Example:

 

 CONNECT ConComp        

 PRINT ColumnarReport OPTION TXT|FILENAME ColumnarReport.TXT|OPEN ON

 

In order to PRINT the report as "Text File", first you need to identify the "Band" to be included for the text file. If a user attempts to PRINT the report as Text File (OPTION TXT) without first having defined the Text File Setup in Report Designer, the program will return an -ERROR- message. The same rule applies when printing the report as Text File using the Print to a File option from the Database Explorer.

 

Here's how to use the "Print to Text File Setup ..." :

 

1.Report Designer | File | Print to Text File Setup...

 

Notice the following options:

 

File Name:

File Type:

Bands:

Available Controls, Select Controls, Save Length

 

2.Select the File Name: Click on [File] Button

 

Example: TestFile.TXT

 

3.Select File Type: Fixed Length

 

Available Options: Comma Delimited, Tab Delimited, Fixed Length

 

4.Select Band: Detail

 

5.Select Column(s) from the list of Available Controls

 

6.If Fixed Length is selected, customize each selected column within "Selected Controls" by entering the field length within the "Save Length" field. You must select the available control, edit the length, then select another control to keep the changes.

 

This step is not required if the Comma Delimited or Tab Delimited option is selected.

 

7.Click [OK] button to save these settings when using Print to Text File.

 

Along with other report settings, these settings will be saved with the report.

 

Repeat step 6. to define the length for each column, if necessary.

 

All of these property settings prepare the report to be printed to a text file.

 

8.While still in Report Designer, Select Report Preview.

 

Click on "Printer" icon

 

Check "Print to File" Option

 

You'll notice the type "Text File" and the Text File Name as defined in Step 2. above.

 

The print dialog will then display a Print to File CheckBox and File... button (so the user can change the file name specified in the Text File Name property).

 

Click [OK] button to print the file as TEXT.

 

9.Close the Report Designer or simply Click on R> Prompt icon from the Tool Bar.

 

10.At the R> Prompt, type:        DIR TestFile.TXT

 

Notice the size of TestFile.TXT file.

 

To view the entire text file, type:

 

LAUNCH TestFile.TXT

 

Take a look at the File using MS NotePad.

 

11.To automate the entire printing process, use:

 

PRINT ReportName WHERE ... ORDER BY ... OPTION TXT|FILENAME TestFile.TXT

 

This will allow the report to print to a text file without user intervention.

 

The report will print to the filename specified in the Text File Name property, but the Print Dialog will not display the Print to File CheckBox or File... button.