
1-copy the jar file in the forms/java directory
2-add the jar name in the archivjinit in the formsweb.cfg
3-add the full path included the jar name in the forms_builder_classpath in the registery (require to restart the forms builder)
4-add the full path included the jar name in the forms_classpath in the default.env
5-create your block
6- create a bean area in your form and set its implementation class to (oracle.forms.demos.bigraph.FormsGraph) -- case sensitive---
7-create your procedure that will pass the data to your graph bean and draw the graph
--- code---- the firs way is to loop your block data
PROCEDURE create_graph_block IS
vItem VARCHAR2(200) := 'emp.empno';
v_graphic_item ITEM := FIND_ITEM ('BEAN_BLOCK.GRAPHIC_BEAN');
vData VARCHAR2(4000);
BEGIN
-- Initialize Graph
SET_CUSTOM_PROPERTY (v_graphic_item,1,'CLEAR_GRAPH','');
GO_BLOCK ('emp');
GO_BLOCK ('emp');
FIRST_RECORD;
LOOP
vData := :emp.ename ',' :emp.ename ','
:emp.sal; SET_CUSTOM_PROPERTY(v_graphic_item,1,'ADD_ROWDATA',vData); IF :SYSTEM.Last_Record = 'TRUE' THEN EXIT;
END IF; NEXT_RECORD;
END LOOP;
-- FIRST_RECORD;
-- Show Graph SET_CUSTOM_PROPERTY(v_graphic_item, 1,'ADD_DATA_TO_GRAPH',''); SET_CUSTOM_PROPERTY(v_graphic_item, 1,'GRAPHTYPE','VERTICAL_BAR');
-- GO_ITEM(vItem);
-- Show Graph SET_CUSTOM_PROPERTY(v_graphic_item, 1,'ADD_DATA_TO_GRAPH',''); SET_CUSTOM_PROPERTY(v_graphic_item, 1,'GRAPHTYPE','VERTICAL_BAR');
-- GO_ITEM(vItem);
end ;
--------------------------------------------------The second way is to pass the data by cursor
PROCEDURE create_gr_cursor IS
vGrafic ITEM := FIND_ITEM ('bean_block.GRAPHIC_BEAN');
vData VARCHAR2(200);
BEGIN
BEGIN
-- Initialize Graph SET_CUSTOM_PROPERTY(vGrafic, 1, 'CLEAR_GRAPH', '');
FOR c_cur IN (SELECT dname, SUM(sal) sum_sal FROM dept, emp
FOR c_cur IN (SELECT dname, SUM(sal) sum_sal FROM dept, emp
where dept.deptno=emp.deptno GROUP BY dname)
LOOP
vData := c_cur.dname ',' 'Total Sales 2000 - 2005' ',' c_cur.sum_sal; SET_CUSTOM_PROPERTY(vGrafic, 1, 'ADD_ROWDATA', vData);
END LOOP;
-- Show Graph SET_CUSTOM_PROPERTY (vGrafic, 1, 'GRAPHTYPE', 'PIE_GRAPH'); SET_CUSTOM_PROPERTY (vGrafic, 1, 'ADD_DATA_TO_GRAPH', '');
END;
-- Show Graph SET_CUSTOM_PROPERTY (vGrafic, 1, 'GRAPHTYPE', 'PIE_GRAPH'); SET_CUSTOM_PROPERTY (vGrafic, 1, 'ADD_DATA_TO_GRAPH', '');
END;
------------------------------------------------------------------------------
2 comments:
where is attachment of jar files
jar file not found
Post a Comment