Printing in A4 format in LANSA for the AS/400

Date:Archived
Product/Release:LANSA for the AS/400
Abstract:A printed document might not have A4 format although the printer file has A4 format in its definition
Submitted By:LANSA Technical Support

Description:

If printing in A4 format is required use the following technique:

  1. On the AS/400 use the CRTPRTF command to create a printer file called, for example, A4FILE. In the definition of the printer file specify the format as A4.
  2. Now, in the LANSA RDML use the DEF_REPORT command and fill the FORMTYPE parameter with the printer file that was created above (A4FILE).

For most situations this will now allow printing in A4 format.

However this may not work in certain situations.

Problem:

One of the possible reasons is because of the invocation level, for example the LANSA function is being called (with the DEF_REPORT) from an RPG program. On the AS/400 it is the OVRPRTF command which allows a printer file to be overridden with different settings. However, the default value of the OVRSCOPE parameter is *CALLLVL which means that "the scope of the override is determined by the current call level". So, although the printer file values have been changed in the DEF_REPORT at the LANSA level because this program was called from a higher level (the RPG program) the options in the DEF_REPORT were essentially ignored.

Solution:

In the DEF_REPORT in the LANSA function use the parameter OTHER_OVR with the value OVRSCOPE(*JOB).

For example:

DEF_REPORT PRT_FILE(A4FILE) OTHER_OVR('OVRSCOPE(*JOB)')

In this situation the override is activated at job level and not at call level and will be allow printing in the correct format.