there may be a better way to do this, but this is how I've gotten it to work. I have logic in case a graph isn't created (there may be data, but the amounts are 0, so no graph is created), so I've left that in this post. You didn't mention if you are doing html or pdf, so this is for html. I can send you the code for pdf if that will help.
-SET &COUNT = 1;
-IF &EMPTYRPT EQ 0 GOTO EMPTYRPTHTML;
-REPEAT HOLDLOOP WHILE &COUNT LE &NOOFACCTS;
GRAPH FILE HOLD220
SUM PCT_MKT_VL AS ''
BY SEC_GRP_NM
WHERE SORTORDER EQ &COUNT
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET HAXIS 600
ON GRAPH SET VAXIS 400
ON GRAPH SET GRAPHSTYLE *
setTitleString("Asset Allocation");
ENDSTYLE
ON GRAPH HOLD AS GRAPH&COUNT FORMAT HTMTABLE
END
-* CHECK TO SEE IF A GRAPH WAS CREATED
-RUN
-SET &NOGRAPH=IF &LINES EQ 0 THEN 'Y' ELSE 'N';
-IF &NOGRAPH EQ 'Y' GOTO EMPTYRPT2;
TABLE FILE HOLD220
SUM
MKT_VL NOPRINT
WHERE SORTORDER EQ &COUNT
ON TABLE HOLD AS HEADER&COUNT FORMAT HTMTABLE
END
TABLE FILE HOLD220
SUM
MKT_VL AS 'Market,Value'
BY MAJCLASS NOPRINT
WHERE SORTORDER EQ &COUNT
ON TABLE HOLD AS TABLE&COUNT FORMAT HTMTABLE
END
-GOTO NEXTHTML
-EMPTYRPT2
TABLE FILE HOLD220
ON TABLE SET PAGE-NUM OFF
HEADING
"ACCOUNT:
" "
PRINT
ACCOUNTID NOPRINT
WHERE SORTORDER EQ &COUNT
ON TABLE HOLD AS HEADER&COUNT FORMAT HTMTABLE
END
-* DO THIS TO CREATE A BLANK GRAPH DOCUMENT SO THERE IS SOMETHING TO DISPLAY
TABLE FILE HOLD220
ON TABLE SET PAGE-NUM OFF
HEADING
" "
PRINT
ACCOUNTID NOPRINT
WHERE SORTORDER EQ &COUNT
ON TABLE HOLD AS GRAPH&COUNT FORMAT HTMTABLE
END
-* DO THIS TO CREATE A BLANK TABLE DOCUMENT SO THERE IS SOMETHING TO DISPLAY
TABLE FILE HOLD220
ON TABLE SET PAGE-NUM OFF
HEADING
" "
PRINT
ACCOUNTID NOPRINT
WHERE SORTORDER EQ &COUNT
ON TABLE HOLD AS TABLE&COUNT FORMAT HTMTABLE
END
-NEXTHTML
-SET &COUNT = &COUNT + 1;
-HOLDLOOP
-HTMLFORM BEGIN
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Trust Portfolio Report
<script>
var finished = false;
function finishedLoading(){
finished = true;
}
-SET &CNT = 1;
-REPEAT HTMLLOOP WHILE &CNT LE &NOOFACCTS;
!IBI.FIL.HEADER&CNT|;
!IBI.FIL.GRAPH&CNT|;
!IBI.FIL.TABLE&CNT|;
-SET &CNT = &CNT + 1;
-HTMLLOOP
-HTMLFORM END
webfocus 8.105M; os: windows; pdf, html, exl2k, csv