Developing powerful Oracle Business Intelligence Beans
Prerequisites
Oracle Forms 10g Rel. 2
•
•
Forms_Demos_10gr2.zip
Installation (1)
Download from OTN: Forms_Demos_10gr2.zip
•download.oracle.com/otndocs/demos/Forms_Demos_10gr2.zip
•Unzip it into an example-Folder of your choice
•Copy FormsGraph.jar into \forms\java
Source-Codes
PROCEDURE BT_Compare IS
vItem VARCHAR2(200) := :SYSTEM.Cursor_Item;
vGrafik ITEM := FIND_ITEM (Const_lokal.itm_Chart);
vData VARCHAR2(200);
BEGIN
-- Initialize Graph
SET_CUSTOM_PROPERTY (vGrafik, 1, 'CLEAR_GRAPH', '');
GO_BLOCK ('UMSATZUEBERSICHT');
FIRST_RECORD;
LOOP
vData := :UMSATZUEBERSICHT.Ums_Geschaeftsbereich || ',' ||
:UMSATZUEBERSICHT.Ums_Jahr || ',' ||
:UMSATZUEBERSICHT.Ums_Umsatz;
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_ROWDATA', vData);
IF :SYSTEM.Last_Record = 'TRUE' THEN
EXIT;
END IF;
NEXT_RECORD;
END LOOP;
FIRST_RECORD;
-- Show Graph
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_DATA_TO_GRAPH', '');
SET_CUSTOM_PROPERTY(vGrafik, 1, 'GRAPHTYPE', 'VERTICAL_BAR');
GO_ITEM(vItem);
END
PROCEDURE BT_Sum IS
vGrafik ITEM := FIND_ITEM (Const_lokal.itm_Chart);
vData VARCHAR2(200);
BEGIN
-- Initialize Graph
SET_CUSTOM_PROPERTY(vGrafik, 1, 'CLEAR_GRAPH', '');
FOR rUms IN (SELECT Ums_Geschaeftsbereich, SUM(Ums_Umsatz) Ums_Umsatz
FROM UMSATZUEBERSICHT
GROUP BY Ums_Geschaeftsbereich)
LOOP
vData := rUms.Ums_Geschaeftsbereich || ',' ||
'Total Sales 2000 - 2005' || ',' ||
rUms.Ums_Umsatz;
SET_CUSTOM_PROPERTY(vGrafik, 1, 'ADD_ROWDATA', vData);
END LOOP;
-- Show Graph
SET_CUSTOM_PROPERTY (vGrafik, 1, 'GRAPHTYPE', 'PIE_GRAPH');
SET_CUSTOM_PROPERTY (vGrafik, 1, 'ADD_DATA_TO_GRAPH', '');
END;
Comments