<<

Contents

Search

>>

 

EXTREPORT

 

 

Function

 

 

Syntax:

EXTREPORT(<Report File>,<Index File>,<Index Key>,<Variable for Errortext>)

 

<Report File>

= <STRING-EXPRESSION>

<Index File>

= <STRING-EXPRESSION>

<Index Key>

= <NUM-EXPRESSION>

<Variable for Errortext>

= <STRING-VARIABLE>

 

 

Meaning:

The function EXTREPORT creates a report from an external report file. The data records of <Index File> are processed in ascending order.

 

In the report editor the report layout can be written into a file with <ALT/X>. The created files can be edited with the program Ebusreport.jar. This can be used in order to adapt forms with the customer without having to change the programming.

 

In the program the function EXTREPORT is then called instead of the instruction REPORT .

 

The file <Report File> must contain a valid report layout.

 

<Index File> specifies the Index File and <Index Key> specifies the key that reads the Index File. The data records are processed in ascending order.

 

EXTREPORT returns the result 0 if no error occurred, otherwise it returns one of the following error numbers. In the case of an error the variable <Variable for errortext> contains the detailed error text.

 

Error number

Meaning

1
2
3
4
5
6
7
8
9
10
11

Error with opening the file <Report File>
The report file is incomplete
Error with reading the report file
1st line is incomplete with report file
Macro not available
Field attribute is faulty
Index File not available
Index File field not available
Auxiliary variable not available
Index File key not available
Dimensioning is faulty

 

Just as internal reports, external report file contains variables and macros. Since external reports can be changed with Ebusreport.jar without having to regenerate the program, the following rules must be considered:

 

All macros and Index Files that are part of the external report must also appear in the generated program. Therefore the ‘original report’, from which the report file was created, should be in the program.

 

When a report is adapted report fields can be changed, deleted or added. If an Index File is used in the program, the program automatically knows all Index File fields. It is different with auxiliary variables. The program only knows those variables that are used in the program. If a new auxiliary variable, which does not appear in the program, is inserted into an external report, EXTREPORT returns error 9. In order to prevent these kinds of errors, it is recommended to build a sort of ‘maximum report’ into the program, from which all external reports can be created without adding new auxiliary variables.

 

External reports may only contain one-dimensional auxiliary variables, multi-dimensional auxiliary variables are not allowed.

 

Parameter:

Report File

Name of report file

Index File

Name of Index File

Index Key

Number of index key

Variable for Errortext

Variable, in which the errortext is written.

 

Sample:

/* Print customer from number 10000 ascending

CUSTOMER.NUMBER = 10000

H% = EXTREPORT("rep7.dat",CUSTOMER,1,ERROR$)

IF H% <> 0

THEN ERRORMES = "Error: " + ERROR$

ENDIF

 

See also:

EXTREPORT_D

REPORT

REPORT_D