IMPRIME
Description
This action is called just before the printing of the document by Crystal Report. Warning ! This action is mandatory, if an initialisation process is specified in the report dictionary. It is not called by the instruction Gosub but by the Call instruction. Two parameters are passed to it, NBPAR (number of parameters) and PARAMETRE (parameters grid). The action must therefore write in the following fashion :
Subprog IMPRIME(NBPAR,PARAMETRE)
Variable Integer NBPAR
Variable Char PARAMETRE()()
...
End
Template
Report
Use
It is used principally to :
update the X3 tables (the print flags, for example).
construct a work table in order that the data may be more easily used by par Crystal Report.
stop the printing of the report by setting GOK = 0
At this level, the report parameters may be used that are stored in the PARAMETRE (1..NBPAR) grid where NBPAR is the number of parameters A parameter is expressed in this grid in the form : parameter name = parameter value. See the detail of the parameters in the help on the EXEC action.
Example
Analyze the entered parameters to apply a selection filter on the table to be printed. This is necessary so that before the print, the records are stored in a work table.
Subprog EXEC(NBPAR,PARAMETRE)
Variable Integer NBPAR
Variable Char PARAMETRE()()
[L]CRITERE = "1=1"
For I=1 To NBPAR
J=instr(1,[L]PARAMETRE(I),"=")
If J
[L]PARAM = left$([L]PARAMETRE(I),J-1)
[L]VALEUR = right$([L]PARAMETRE(I),J+1)
Case [L]PARAM
When "sitestart" : [L]CRITERE -= "& SALFCY>='"+[L]VALEUR+"'"
When "siteend" : [L]CRITERE -= "& SALFCY<='"+[L]VALEUR+"'"
Endcase
Endif
Next
Filter [F:SIV] Where evalue([L]CRITERE)
Gosub TRT_SIV: # storage in the work table