April 23, 2007, 10:47 AM
Adrian WongWhy Column Totals Not Showing?
Hi there,
This report gives row totals but when I add in code for column totals, the report keeps running forever and never completes. I have checked the stylesheet and it allows for GRANDTOTAL like this: "TYPE = GRANDTOTAL, STYLE=BOLD, $"
I have even tried to explicitly declare the GRANDTOTAL at the end of the code but nothing works as seen in there.
The code looks like this:
JOIN
DIN_NO IN BASEINFO TO DIN_NO IN CODE9CONDITION AS J0
END
JOIN
CODE9_SUBCODE IN BASEINFO TO CODE9_SUBCODE IN XREFCODE9 AS J1
END
DEFINE FILE BASEINFO
CONTROL_YEAR/I4 = &CONTROL_YEAR;
CONTROL_MD/I4 = 1231;
CONTROL_YMD/I8YYMD = EDIT(EDIT(CONTROL_YEAR) || EDIT(CONTROL_MD));
ASAT_DATE/MtDYY = CONTROL_YMD;
GENDER/A6 = IF GENDER EQ 'M' THEN 'Male' ELSE 'Female';
END
TABLE FILE BASEINFO
SUM
CNT.GENDER/I7CS
BY
CODE9_SUBCODE AS 'Subcode'
BY
CODE9_SUBDESCENG AS 'Description'
ACROSS
GENDER AS ''
HEADING
"Driver Control Statistics"
" "
FOOTING
"Report ID: DCS-&REPORT_ID "
ON TABLE SUBFOOT
" "
"NOTE: Report counts of licensed drivers:
WHERE (ACTIVE_DRIVER EQ 'A');
WHERE (AGE GT 15);
WHERE (HAND_CONTROL EQ 'Y' OR GLASSES EQ 'Y' OR ZENDORSEMENT EQ 'Y');
WHERE (LIC_CLASS_CODE NE MISSING);
WHERE READLIMIT EQ 100
WHERE RECORDLIMIT EQ 100
ON TABLE SET PAGE-NUM OFF
ON TABLE ROW-TOTAL AS 'Total'
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT PDF
ON TABLE SET CSSURL '/approot/mtomis/report.css'
ON TABLE SET STYLE *
-GOTO STY_&WFFMT
-GOTO STY_PDF
-*
-STY_HTML
-STY_EXL2K
-MRNOEDIT -INCLUDE STYLE01
-GOTO STY_END
-*
-STY_PDF
-MRNOEDIT -INCLUDE DCSSTYLE02
-*
-STY_EXCEL
-STY_END
TYPE=REPORT,
COLUMN=N2,
WRAP=6.105556, $
$TYPE=REPORT, ACROSSCOLUMN=N3, STYLE=BOLD, $
$TYPE=REPORT, ACROSSCOLUMN=N4, STYLE=BOLD, $
$TYPE=REPORT, COLUMN=N3, SIZE=11, $
$TYPE=REPORT, COLUMN=N4, SIZE=11, $
$TYPE=GRANDTOTAL, ACROSS=N3, STYLE=BOLD, $
$TYPE=GRANDTOTAL, ACROSS=N4, STYLE=BOLD, $
$TYPE=GRANDTOTAL, COLUMN=N3, SIZE=11, $
$TYPE=GRANDTOTAL, COLUMN=N4, SIZE=11, $
$TYPE=GRANDTOTAL, STYLE=BOLD, $
ENDSTYLE
END
-LO39_END
-END_DCS_L03
Thank you.
April 23, 2007, 11:22 AM
ETNot sure if this is problem but you have
have
ON TABLE NOTOTAL
in your code which normally suppresses grand totals.
ON TABLE ROW-TOTAL AND COLUMN-TOTAL maybe what you want here.
Good luck.
April 23, 2007, 11:28 AM
smithsAdrian,
I also suggest that you use a different field name for the A6 GENDER column.
You have a field called GENDER in your table that is presumably A1, then you are assigning a value to the same field name.
quote:
GENDER/A6 = IF GENDER EQ 'M' THEN 'Male' ELSE 'Female';
This could cause you problems.
Regards,
Sean
April 23, 2007, 12:34 PM
Adrian WongThanks. With regard to using the GENDER column name it works fine. Also works if I simply substitute "SEX" for "GENDER" say.
With regard to the "NOTOTAL" I have removed it before and used "ON TABLE COLUMN-TOTAL AS 'Total'" and the report never completes successfully. I thought at first that if I use the table default like ON TABLE COLUMN-TOTAL" it would work but that's what causes the problem in the first place. Either that or something in the stylesheet. I've tried all sorts of other commands like RECOMPUTE, SUMMARIZE but no luck.
April 23, 2007, 12:40 PM
smithsquote:
"NOTE: Report counts of licensed drivers:
You don't have a double-quote to end this statement.
April 23, 2007, 01:29 PM
ETSmiths is correct. I have experienced strange behavior in the past when I inadvertantly left off an ending quote on subhead/subfoot lines.
April 23, 2007, 02:12 PM
Adrian WongOh, that was only because I was deleting the company name for this message but the original code has the ending quote. However, I will check the code again for other potential missing code but I think I have done that peeviously. Thanks.