IIF with expressions
Mikel.Pahl
Karlsruhe
We want dependig on Databasefield postfach print the Datafiled strasse or the datafield postfach with the word Postfach in front.
We have tried saveral combinations like this one:
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">,"[Postfach <QFili."POSTFACH">]")]
But it dosent work.
this works:
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">, <QFili."POSTFACH">)]
an this too
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">,'Postfach')]
Is ist possible to combine Datafiled and Textobjects in the false or true expressions of IIF
We have tried saveral combinations like this one:
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">,"[Postfach <QFili."POSTFACH">]")]
But it dosent work.
this works:
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">, <QFili."POSTFACH">)]
an this too
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">,'Postfach')]
Is ist possible to combine Datafiled and Textobjects in the false or true expressions of IIF
Comments
[IIF(<QFili."POSTFACH">='',<QFili."STRASSE">,'Postfach '+<QFili."POSTFACH">)]
In another Report is now an Castproblem remaining in the IIF:
[IIF(<Rechnungen_Lauf."SKONTO">=0,'',<Rechnungen_Lauf."SKONTO">+' bis '+<Rechnungen_Lauf."SKONTODATUM">)]
Exception of Calss EVariantTypeCasError
Variant of this Type (String) could not convertet to Type (Currency)
Datafield Rechnungen_Lauf."SKONTO is Currency
Datafield Rechnungen_Lauf."SKONTODATUM" is Date
if the the display format of the memo is set to something other you may get a bad type cast error. so you must add required functions around true value, false value members.
another way is to use the obp event of the band or memo to alter the contents of the memo and use inline formating tags in your expressions
ie
if <datafield> > 0.00 then
begin
memo1.text := '[expression]' +' ' +'[expression with format tag]'
end
else
begin
memo1.text := other value
end;
see the user manual chapter on inline formatting