Purpose

SET_RPTOPT sets the current report device name and device type for subsequent report output. It also supports the transformation of XML reports with an XSL transform and the rendering of the documents on a PROIV Client workstation.
 

Syntax

SET_RPTOPT (operand1,operand2,operand3,operand4)
 

Operation

operand1 is any valid alphanumeric constant, variable or expression up to 40 characters in length that specifies the device/file name for reports. Note that this parameter should not contain a drive letter when used Microsoft Windows as this affects how the string is read. This limitation affects all Output Types, in particular those that use file names (8,11,13). See the Example section for more information.

operand2
 is any valid alphanumeric constant, variable or expression representing a numeric integer value that specifies the device
type for reports. 

Valid values for the device type are:

Value

Description

1

spooled - logical device

2

spooled - file

3

spooled - physical device

4

network print via client 

5

crt - screen output

6

attached printer

7

undefined

8

file

9

physical device

10

not in use

11

enables Client-Side XML Transform

12

not in use

 

13

enables Server-Side XML Transform

 

 

OUTFMT: output format - takes the following options:
D –
Output is delimited. The default delimiter is a comma. It can be changed by adding the required delimiter within double quotes immediately after the D.
X –
Output type is XML to Screen

The following options only apply to the XML transform and consequently follow the X value:
E
– Explicit Tag Names Only
I
–  Don’t Indent Output
Z
– Suppress Sequence Nos
A
– Alternate Tag Names
S
– Output Source Attribute  

operand3 holds the name of the XSL file if you want to transform an XML report. The XSL files must be stored on the server in the directory specified by the Environment Variable PROIV_XSL (or in the default /xsl directory) if they are to be found at runtime. The PROIV_XSL Environment Variable is set in the pro4v[n].ini file.

When you are not using an XML transform, operand3 is mandatory, but must be "", and operand4 should not exist.

operand4 holds the name of the physical file which is output to the PROIV Client.  For example, entering myreport.pdf will send the report to a physical file called myreport.pdf and open it with the application associated with .pdf extension.
 

Remarks

The report device type and name set by SET_RPTOPT override those set by $SPOOL for a function and are, in turn, overridden by the current contents of the @RPTOPT system variable.

If used in a Report Function, SET_RPTOPT must be used in Function Entry Logic. It has no effect if executed after this point.
 
It can also be specified within a Screen Function to set the report device name and type for the next Report Function.  

These values remain in effect until completion of a Report Function.
 

Example

SET_RPTOPT ("printfile","8","") sends report output to the file called 'printfile' to a physical device mapped to 8.

 

SET_RPTOPT with Client-Side PDF printing example:

SET_RPTOPT("CRT:OUTFMT=XEIZ", "11", "demo.xsl", "demo.pdf")

  • The first parameter ("CRT:OUTFMT=XEIZ") states that the report output is XML - to Screen, with various XML options set.

  • The second parameter ("11") states that this is a client-side XML transform.

  • The third parameter ("demo.xsl") holds the XML transform file name.

  • The fourth parameter ("demo.pdf") holds the output file name.

 

SET_RPTOPT with Server-Side XML Transform example:

SET_RPTOPT("filename.pdf:OUTFMT=XEIZ", "13", "demo.xsl")

  • The first parameter ("filename.pdf:OUTFMT=XEIZ") states that the report output is XML to file ‘filename.pdf’, with various XML options set. Note that this parameter should not contain drive letter when used with the Server-Side XML Transform Output Type on Microsoft Windows as this affects how the string is read. To specify the full path, start after the colon, i.e.  C:/temp/file.xml is entered as /temp/file.xml - If the 1st ‘/’ is omitted, the path/file is created in the current working directory, e.g. Windows/System32.

  • The second parameter ("13") states that this is a server-side XML transform.

  • The third parameter ("demo.xsl") holds the transform file name.

 

SET_RPTOPT with delimited file example:

SET_RPTOPT('file.csv:OUTFMT=D"\t"','8','')

  • The first parameter (file.csv) defines the output location.

  • The second parameter (OUTFMT=D) states it is delimited.

  • The delimiter is changed to TAB by the \t in double quotes.

 

Comment on this topic

Topic ID: 520117