ADELIA |
VADELIA |
SADELIA |
|
EADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(B) (S) |
Warning
Concerning Visual Adelia programs :
"CLOSE ViewName" must be used only in the server side,
"CLOSE LayoutCode" must be used only in the client side.
Concerning Event Adelia programs :
"CLOSE ViewName" must be used only in the server side,
"CLOSE LayoutCode" is not compatible.
Section for use
All
Syntax
CLOSE ViewName
CLOSE LayoutCode
CLOSE LayoutCode *PRV
Important note: This last syntax type is only valid for batch VADELIA programs with reports of Crystal Reports kind.
Description
This instruction is used whenever closing files or layouts within a program.
The file cannot be used in the program anymore, if not explicitely re-opened with the OPEN instruction.
You can only close files that have previously been opened - either implicitly or using the OPEN instruction.
By default, file opening and closing operations are managed implicitly by Adelia.
If you need to manage file and layout opening and closing operations manually, you must modify the default generation options, specifying that you want to manage file opening operations, or specify the *OPEN parameter when using the DEFINE_VIEW or VIEW instructions to make declarations.
As a result, the program will not automatically open and close the file at the start and end of its execution, enabling you to manage these operations at any time.
Whenever a layout file is to be opened/closed, a similar parameter must also be updated in the generation options.
The *PRV parameter is used to close the layout file and display a print preview screen.
It is also possible to use these instructions without modifying the generation options. In this case, you must naturally use "CLOSE ViewName" before "OPEN ViewName".
If the generation options have been modified to ask for a file opening, it is possible to open it with the AS/400 commands (OPNDBF, etc.).
Warning: With screen layouts, "CLOSE LayoutCode" is ignored by the C generator and cannot be used with interactive VADELIA programs.
From Adelia Studio version 13.0 PTF05 onwards:
With Adelia Cloud, previews are displayed in PDF format in a browser tab.
The data is cached for 30 minutes (by default). This ensures compatibility with PDF document viewers (Google Chrome and Microsoft Edge in particular) which can launch several download requests.
This wait time is configurable by changing the timeToIdleSeconds and timeToLiveSeconds parameters of the wagonDownloadCache cache in the ehcache.xml file of your Wagon application.
NB: it is strongly recommended that you do not change the other parameters of this file, particularly the parameters of the other caches.
When it concerns a report template, the CLOSE instruction updates the reserved word *RETURN_CODE.
- If it succeeds, the reserved word takes the *NORMAL value.
If it fails, the possible values are dependent on the type of report and generation platform.
For the Windows generation platform:with an Adelia report, the only possible failure value is "1".
with a Crystal Reports report, the possible values are as follows:
1 Unable to load Crystal Reports runtime 2 The report was not opened 3 Unable to open a subreport of the report 4 Preview not allowed 5 Preview failed 6 Unable to link data for the report 7 Unable to link data for a subreport 8 Export failed 9 Unable to send mail 10 Display of print properties is prohibited 11 Unable to display print properties 12 Unable to list printers 13 Printer not found 14 Unable to display additional print properties 15 Unable to select a printer 16 Unable to print
Example
* Close immediately the PARAM file since if not needed afterwards.
* Note: "Open" parameter is left blank in generation options.
PARAM_KEY = 'TAX'
CHAIN PARAMETERS
W_TAX_RATE = PARAM_TAX_RATE
CLOSE PARAMETERS
*
* Open and close the report layout to print the grand total only
* Note: it is not automatically opened ('Y' in generation options)
OPEN INV950
PRINT HEADER_FMT
PRINT TOTAL_FMT
CLOSE INV950
*
* Open and close the report layout of Crystal Reports kind, with a print preview.
* Print orders
OPEN LAYNAME
READ ORDERS
DO_WHILE ORDERS EXIST
READ ORDERS
REDO
CLOSE LAYNAME *PRV