I have a formula with multiple groupings in the report, at the lowest level grouping, the "items", I have a formula with an if statement giving me problems.
Here are my main sections in the report:
office group header
dept group header
jobtitle group header
userid group header -> variables reset here
items number header
details (empty)
items footer -> main formula and test formula here
userid footer -> output string formula and user info here
jobtitle footer
dept footer
office footer
For most userid's the formula creates a running total string for the items belonging to a particular user. The total for the string is printed out for each user in the user group footer and then reset for the next user in the group header for the user group.
The running total doesn't need to calculate if the user has a certain jobtitle code, either RC or ARC. Otherwise it should calculate as described above.
*****Code******
WhilePrintingRecords;
Global StringVar ItemsOutputArr1;
// other variables left out for brevity, I have more than one output array
if IsNull({USERTABLE.JOBTITLE}) or not ({USERTABLE.JOBTITLE}='RC' or {USERTABLE.JOBTITLE}='ARC') then (
//Calculating the output string runs
);
******End Code*******
I have also put a simple test formula in the same footer as my main formula, the items footer, to test my if conditions. When my jobtitle is blank, or null in the database:
If the test formula is NOT({USERTABLE.JOBTITLE}='RC') the value returned is blank.
If the test formula is: IsNull({USERTABLE.JOBTITLE}) the value returned is true.
If the test formula is: {USERTABLE.JOBTITLE}='ARC' the value returned is blank.
If the test formula is: not({USERTABLE.JOBTITLE}='ARC') the value returned is blank.
If the test formula is: not ({USERTABLE.JOBTITLE}='RC' or {USERTABLE.JOBTITLE}='ARC') the value returned is blank.
How can I make this statement evaluate correctly so it will return true and false like I think it's supposed to?
Please let me know if you have any ideas! Thank you!
Here are my main sections in the report:
office group header
dept group header
jobtitle group header
userid group header -> variables reset here
items number header
details (empty)
items footer -> main formula and test formula here
userid footer -> output string formula and user info here
jobtitle footer
dept footer
office footer
For most userid's the formula creates a running total string for the items belonging to a particular user. The total for the string is printed out for each user in the user group footer and then reset for the next user in the group header for the user group.
The running total doesn't need to calculate if the user has a certain jobtitle code, either RC or ARC. Otherwise it should calculate as described above.
*****Code******
WhilePrintingRecords;
Global StringVar ItemsOutputArr1;
// other variables left out for brevity, I have more than one output array
if IsNull({USERTABLE.JOBTITLE}) or not ({USERTABLE.JOBTITLE}='RC' or {USERTABLE.JOBTITLE}='ARC') then (
//Calculating the output string runs
);
******End Code*******
I have also put a simple test formula in the same footer as my main formula, the items footer, to test my if conditions. When my jobtitle is blank, or null in the database:
If the test formula is NOT({USERTABLE.JOBTITLE}='RC') the value returned is blank.
If the test formula is: IsNull({USERTABLE.JOBTITLE}) the value returned is true.
If the test formula is: {USERTABLE.JOBTITLE}='ARC' the value returned is blank.
If the test formula is: not({USERTABLE.JOBTITLE}='ARC') the value returned is blank.
If the test formula is: not ({USERTABLE.JOBTITLE}='RC' or {USERTABLE.JOBTITLE}='ARC') the value returned is blank.
How can I make this statement evaluate correctly so it will return true and false like I think it's supposed to?
Please let me know if you have any ideas! Thank you!