startReport()
The textReport.startReport() function passes control of the printing from the text report handler to the Java™ report engine. You must supply values for all arguments. Use the null keyword in any position where you want to accept the default value. These arguments override any default values, or values set by the constructor function (see Creating a TextReport variable.
The engine does not call any functions in the handler as a result of the textReport.startReport() function. Headers are printed as a result of calling the textReport.outputToReport() function (see outputToReport()).
The signature of the function differs slightly between COBOL generation and Java™ generation. For COBOL generation, the topOfForm argument is not used because you cannot send a report directly to a printer when you generate for COBOL.
Syntax
textReport.startReport(
fileName STRING? in,
topMargin INT? in,
bottomMargin INT? in,
leftMargin INT? in,
rightMargin INT? in,
pageLength INT? in,
topOfForm STRING? in)
- textReport
- The name of a variable that is based on the TextReport external type.
- fileName
- The name of a file, in quotation marks. If this parameter has a null value, the output is directed to standard output (STDOUT).
- topMargin
- An integer that represents the number of blank lines at the top of each page. If this parameter has a null value, the report uses the default value of 3.
- bottomMargin
- An integer that represents the number of blank lines at the bottom of each page. If this parameter has a null value, the report uses the default value of 3.
- leftMargin
- An integer that represents the number of spaces to the left of each line. If this parameter has a null value, the report uses the default value of 5.
- rightMargin
- An integer that represents the default right margin for wordwrap operations. If this parameter has a null value, the report uses the default value of 132.
- pageLength
- An integer that represents the number of lines on each page, including the top margin, header, trailer and bottom margin. If this parameter has a null value, the report uses the default value of 66.
- topOfForm
- This argument is available for Java™ generation only. The first character of this string is used to issue a form feed to the printer. There is no default for this parameter; if you want a top-of-form character, you must specify one.
Example
The following example starts the report generation process, using default values for everything except the name of the output file and the top-of-form character (specifying the standard ASCII form feed character, 0x0C). Because the directory separator character on Windows™ is the same as the escape character in EGL, you must use a double backslash to separate directory names, or use a forward slash, which Java™ translates to the appropriate separator for the local platform.
myReport TextReport = new TextReport();
...
myReport.startReport("C:/temp/reportFile.txt",
null, null, null, null, null, "\u000C");