I have the following code. my problem is when I run the report the subfoot is not displayed. Hold3 is two reports hold1 and hold2 using the MORE command. Any ideas
DEFINE FILE HOLD3 FLAG1/A5=IF LINE_ITEM_ADJUSTED_TYPE EQ 'OTHR' OR 'CONN' THEN IF NEW_ITEMCODE NOT LIKE '%OTHR%' OR '%CONN%' THEN 'TRUE' ELSE 'FALSE'; END TABLE FILE HOLD3 PRINT 'QUANTITY' AS 'Quanity' 'NEW_ITEM_MEAS' AS 'Unit Meas' 'NEW_ITEMCODE' AS 'Item Code' 'SA_NUM' AS 'S.A.,Number' 'NEW_ITEM_DESC' AS 'Item,Description' 'PAGENUM' AS 'Page No.' 'AWD_UNIT_PRICE' AS 'Unit Price' 'ItemPaidAmt' AS 'Item Paid,Amount' 'CONTRACT_LINE_ITEMADJ_AMT' AS 'Line Item,Adjustment,Amount' 'LINE_ITEM_ADJUSTED_TYPE' FLAG1 BY 'PROJECT_ID' NOPRINT BY 'LINE_ITEM_NBR' NOPRINT ON 'LINE_ITEM_NBR' SUBFOOT "Contract Adjustments for Pay Item Code: WHEN FLAG1 EQ 'TRUE';
February 16, 2006, 04:06 PM
dhagen
The define does not look correct to me. You are doing things that may not be officially supported. Try:
DEFINE FILE HOLD3
FLAG1/A5=IF (LINE_ITEM_ADJUSTED_TYPE EQ 'OTHR' OR 'CONN') THEN 'TRUE' ELSE
IF (NEW_ITEMCODE OMITS 'OTHR' OR 'CONN') THEN 'TRUE' ELSE 'FALSE';
END
I'm not sure I got your logic correct, but hopefully you get the idea.
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
February 17, 2006, 03:54 AM
Tony A
Mike's IF statement is just fine even though it is not usually what WF coders use? I would prefer to use the second of these two -
FLAG1/A5 = IF COUNTRY EQ 'ENGLAND' OR 'JAPAN' THEN IF CAR NOT LIKE '%IUM%' OR '%SU%' THEN 'TRUE' ELSE 'FALSE';
FLAG2/A5 = IF ((COUNTRY EQ 'ENGLAND' OR 'JAPAN') AND (CAR NOT LIKE '%IUM%' OR '%SU%')) THEN 'TRUE' ELSE 'FALSE';
Both are seemingly the same although the second one is controlling the logic completely and is more readable. Again, it might not be exactly what Mike requires.
The main reason that I can see for the subfoot not being displayed (despite a typo) is that I am not sure on the validity of the WHEN clause combined with a SUBFOOT.
One method that would give you a subfoot is to extend your defines -
MYSUBFOOT/A80 = IF FLAG1 EQ 'FALSE' THEN 'Contract Adjustments for Pay Item Code:' ELSE '';
and then use it in the subfooting
ON LINE_ITEM_NBR SUBFOOT
"<MYSUBFOOT"
You could assign this value to FLAG1 instead of using the true or false values.
TThis message has been edited. Last edited by: Tony A,
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
February 17, 2006, 12:58 PM
N.Selph
You can certainly use WHEN with SUBFOOTs and have multiple lines with conditions. This is taken from a report that works:
ON PLWNTYP SUBFOOT
"Comments"
WHEN CMMT_1 NE ''
ON PLWNTYP SUBFOOT
"<USER_1> <DATE_1> <CMMT_1 "
WHEN CMMT_1 NE ''
ON PLWNTYP SUBFOOT
"<USER_2> <DATE_2> <CMMT_2 "
WHEN CMMT_2 NE ''
ON PLWNTYP SUBFOOT
"<USER_3> <DATE_3> <CMMT_3 "
WHEN CMMT_3 NE ''
ON PLWNTYP SUBFOOT
"<USER_4> <DATE_4> <CMMT_4 "
WHEN CMMT_4 NE ''
ON PLWNTYP SUBFOOT
"<USER_5> <DATE_5> <CMMT_5 "
WHEN CMMT_5 NE ''
ON 'LINE_ITEM_NBR' SUBFOOT "Contract Adjustments for Pay Item Code: WHEN FLAG1 EQ 'TRUE';
is the actual code, then it should be this:
ON 'LINE_ITEM_NBR' SUBFOOT "Contract Adjustments for Pay Item Code:" WHEN FLAG1 EQ 'TRUE';
Just a suggestion, but I'd also lose the single quotes on the fieldnames.
We just started testing 7.1.1 and IBI is really tightening up the code as to correct syntax - which is a very good thing, IMHO. Not sure if the "single quote" may be a problem, plus it might look a bit confusing to some.
February 21, 2006, 07:58 AM
Mike Johnson
Thanks for all the suggestions, I not sure why but all I had to do was to reverse my hold files. Instead of
table file hold1 .. more file hold2
I used table file hold2 .. more file hold1
The define I'm using now is
DEFINE FILE TEROT001_RDWY_CNTRT FLAG1/A1=IF DSSOT033.LINE_ITEM_ADJUSTED_TYPE EQ 'OTHR' OR 'CONN' THEN 'T' ELSE 'F'; END
Again thanks for the help. You gave me some things to consider when doing defines and if statements.