Information générale
Catégorie:
Gestionnaire de rapports & Rapports
>
COPY STRUCTURE EXTENDED TO holdtbl
SELECT 0
USE holdtbl
SELECT holdtbl
SCAN
IF(holdtbl.field_name = "c_ordrcode")
lcorder = "c_ordrcode"
ELSE
lcorder = "O_rec_id"
ENDIF
ENDSCAN
drop table holdtbl
So if C_ordrcode is in the table then I want the c_ordercode printed, otherwise I want the O_rec_id printed.
See what I mean?
<
If the table is in the DBC, how about:
Code in a program calling the report:
PRIVATE plUse_C_Ordrcode && this or public in report.INIT required for variable to have scope
plUse_C_Ordrcode = INDBC ("TableName.c_ordrcode", "FIELD")
Value in the report field:
IIF (plUse_C_OrdCode, c_ordrcode, O_rec_id)
In this case, macro substitution may offer an appropriate alternative -- as that would be performed once for the report, the IIF for each line of the report.
In that case, I think the problem is the scope of your original variable -- make sure to declare it a private in a routine calling the report, or a public in the report INIT and then release it upon report conclusion.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement