A customer of mine needed to create a report sorted across showing the verb objects under each other. It was also necessary to color the columns. This is the code (using the CAR file for demo purposes):
-SET &OVERFIELDS=3;
TABLE FILE CAR
SUM
RCOST AS 'RETAIL COST' OVER
DCOST AS 'DEALER COST' OVER
SALES
ACROSS BODYTYPE
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE OFF
ON TABLE SET ACROSSTITLE SIDE
ON TABLE SET STYLE *
INCLUDE=ENDEFLT,
$
TYPE=REPORT, GRID=OFF, BORDER=LIGHT,
$
-REPEAT #MOLSA1 FOR &I FROM 1 TO 99;
-SET &J=&I - 1;
-SET &K=&J / &OVERFIELDS + 1;
-SET &BCOL=IF IMOD(&K, 2, 'I1') EQ 1 THEN '211 214 216' ELSE '255 255 255';
type=data,
column=P&I,
backcolor=rgb(&BCOL),
border-bottom=light,
border-bottom-color=rgb(128 128 128),
$
-#MOLSA1
ENDSTYLE
END
Since the customer really needed this, an alternate master for a HOLD file was used as a workaround:
DEFINE FILE CAR
RCOST/I6=RCOST;
DCOST/I6=DCOST;
SALES/I6=SALES;
END
TABLE FILE CAR
SUM
RCOST
DCOST
SALES
BY BODYTYPE
ON TABLE HOLD AS SIDE4OVER FORMAT ALPHA
END
-RUN
EX -LINES 8 EDAPUT MASTER,SIDE4OVER,C,MEM
FILENAME=SIDE4OVER, SUFFIX=FIX
SEGMENT=SIDE4OVE, SEGTYPE=S0
FIELDNAME=BODYTYPE, ALIAS=E01, USAGE=A12, ACTUAL=A12, $
SEGMENT=COST, PARENT=SIDE4OVE, OCCURS=VARIABLE
FIELDNAME=COST, ALIAS=E02, USAGE=I6, ACTUAL=A06, $
FIELDNAME=FIELDNO, ALIAS=ORDER, USAGE=I2, ACTUAL=I4, $
DEFINE FIELDNM/A16=DECODE FIELDNO(1 'RETAIL COST' 2 'DEALER COST' 3 'SALES' ELSE 'COST');
-RUN
TABLE FILE SIDE4OVER
SUM
COST AS ' '
BY FIELDNM AS ' '
ACROSS BODYTYPE
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE OFF
ON TABLE SET ACROSSTITLE SIDE
ON TABLE SET STYLE *
INCLUDE=ENDEFLT,
$
TYPE=REPORT, GRID=OFF, BORDER=LIGHT,
$
-REPEAT #MOLSA2 FOR &I FROM 2 TO 99;
-SET &BCOL=IF IMOD(&I, 2, 'I1') EQ 0 THEN '211 214 216' ELSE '255 255 255';
type=data,
column=P1,
COLOR=WHITE,
backcolor=rgb(64 64 64),
border-bottom=light,
border-bottom-color=rgb(0 0 0),
$
type=data,
column=P&I,
backcolor=rgb(&BCOL),
border-bottom=light,
border-bottom-color=rgb(128 128 128),
$
-#MOLSA2
ENDSTYLE
END
The output: ALTERThis message has been edited. Last edited by: FP Mod Chuck,
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF