KB0047

How do I Print my Report to a File?

Applies to: VC/m, RE/m, RE/data and RE/parser

Using a File Output Device

In order to use any output device, it must first be defined in the Printers option of the Set-up. (See the instructions below for how to do this.)

To use an output device called FILE with the filename set to "???":

At any Output Device prompt, enter the printer name, followed by a single space, followed by the actual file name (including the path if necessary), eg

Output Device [FILE MYFILE.TXT ]

Defining a File Output Device

An output device which is a file can be set up so that the user enters the file name at the time when they print a report. This is done by using the string "???" as a placeholder for the file name in the output device definition. Alternatively, the output device can be set up with a specific file name which is always used.

"???" can also be used as a placeholder for part of the file name. For example, using /usr/vcmreports/???.txt would mean that the file will always be created in the specified directory with an extension of .txt, but the user can choose the first part of the file name at the time when they print the report.

In all of the following examples, the output device is named FILE and a file name and path are not pre-defined. To use a specific file name, simply replace ??? in the examples with the file name (and path) which you wish to use.

The examples use DOSFILE as the device type. The device type determines the page length, page width and other formatting characteristics of the file which is created. Depending on the purpose of the file, you may wish to adjust the device type settings, use one of the other standard device types or create a new one to suit your needs.

The settings which are used to define an operating system file as an output device depend on your M implementation:

Caché and ISM

Printer name [FILE ] Device ID [??? ] Device type [DOSFILE ] Open parameters ["WNS" ] Use parameters [ ] Close parameters [ ]

GT.M

Printer name [FILE ] Device ID [??? ] Device type [DOSFILE ] Open parameters [NEWVERSION ] Use parameters [ ] Close parameters [ ]

DSM

Printer name [FILE ] Device ID [??? ] Device type [DOSFILE ] Open parameters [NEWVERSION ] Use parameters [ ] Close parameters [ ]

MSM

Printer name [FILE ] Device ID [51 ] Device type [DOSFILE ] Open parameters [("???":"W") ] Use parameters [ ] Close parameters [ ]

DTM

Printer name [FILE ] Device ID [10 ] Device type [DOSFILE ] Open parameters [(file="???":mode="w") ] Use parameters [ ] Close parameters [ ]

Last reviewed: Nov 22, 2004

Back to VC/m Knowledge Base Articles