Focal Point
Question about Graphs in 5.3.6

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/1531028371

June 27, 2006, 10:17 AM
Preetham
Question about Graphs in 5.3.6
I have a tabular report like,

Table file employee
print job_code working_hrs nonworking_hrs
by manager
by employee
by month_year
end

Now i need to print graph for the same report where x axis will be month_year and y-axis will be working_hrs and nonworking_hrs. The graph should be for each employee and i want to place this graph just after each employee like,

Tobular Report for employee A

Graph for Employee A

Page Break

Tobular Report for employee A

Graph for Employee A

Page Break

etc,,

Any help in this regard will be highly appreciated.

Thanks and Regards
June 28, 2006, 11:10 AM
Pam Kratt
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
June 28, 2006, 03:28 PM
bcowley
Create a loop with dialog manager. Within this loop do two things, first create the graph you want, saves it as a GIF file, then create the report you want. Embed the GIF into the report in the footer and save as PDF.

Loop for all records.

Use WEBFOCUS's COMPOUND reporting to merge all the pdf files together to form your output.

The reports will automatically pagebreak.

I've done plenty of graphing using this technique.


______________________
WF Version: Prod/Test : WebFOCUS 7.67; ETL 7.67

OP system: WIN2K