Strange IIF behavior
Posted: Sun Jan 11, 2009 3:49 pm
Using version of 5 January 2009.
My sample project has this IIF in the group totals, to print "is zero" when the sum is zero and "" when the sum is not zero:
This is the designer screenshot, in red square is the field with the problem:

It should give this output:

But it gives this:

If in the field containing the IIF function (the field is called "Testo2" in my sample project) i set "CanShrink" i obtain this:

If, in the IIF, i change the string returned for the false condition to something > "" (eg. "is not zero"):
everything works as expected (with the new IIF), with "CanShrink" or without:

but, as i told initially, i want a blank string when the sum is != 0.
Note: if i put the field containing the IIF (called "Testo2") in the group header, it works as expected, except when i set "CanShrink": in this case, the field is never printed.
It seems to be a problem when the IIF contains a "" as result and/or when the IIF is in the group footer (and something strange happens in "CanShrink" too).
You can download IIF.zip containing the sample project and report from:
http://www.aziwin.it/public/files/IIF.zip
Thank you.
My sample project has this IIF in the group totals, to print "is zero" when the sum is zero and "" when the sum is not zero:
Code: Select all
{IIF(Sum(MyTable.Value)==0,"is zero","")}

It should give this output:

But it gives this:

If in the field containing the IIF function (the field is called "Testo2" in my sample project) i set "CanShrink" i obtain this:

If, in the IIF, i change the string returned for the false condition to something > "" (eg. "is not zero"):
Code: Select all
{IIF(Sum(MyTable.Value)==0,"is zero","is not zero")}

but, as i told initially, i want a blank string when the sum is != 0.
Note: if i put the field containing the IIF (called "Testo2") in the group header, it works as expected, except when i set "CanShrink": in this case, the field is never printed.
It seems to be a problem when the IIF contains a "" as result and/or when the IIF is in the group footer (and something strange happens in "CanShrink" too).
You can download IIF.zip containing the sample project and report from:
http://www.aziwin.it/public/files/IIF.zip
Thank you.