Professional Documents
Culture Documents
Include Graphics Charts On Forms 6i
Include Graphics Charts On Forms 6i
[edit]
Steps
[edit]
Build a Oracle Graphics application
Open Oracle Graphics Builder (GOBLD60.EXE), connect with a database
user(like scott/tiger), then create a new "display"(CTRL+N)
Double click on "Queries" to build your query like this:
select b.dname, count(*) from emp a, dept b where a.sal>=:pr_sal and
a.deptno=b.deptno group by b.dname
In this example, this query show how people works on each depts, and filter only
people where have sal ">=" a especified parameter value;
Create Parameter with name "PR_SAL" and set this type to "NUMBER";
On "Layout Editor" Window, drag and drop a chart item, and choose the query0
to link with this object. Next, choose the type of your chart(pie, bars, etc..) and give a
Name and Title for this chart;
Save(like sal.ogd) and compile this Graphics.
[edit]
Build a Oracle Forms and include the Graphics
Open Oracle Forms builder, connect with a database user(like scott/tiger), then
create a new "Forms"(CTRL+N)
Atach on this forms the librarie OG.PLL (see Object Navigator node "Atached
Libraries")
Create a new data block (no base table) and build a text_item field (to user
enter a parameter value to pass to Graphics as PR_SAL), alter the datatype to number;
On Canvas, drag and drop a chart item object, and choose "Build a new chart
manually";
Double click on chart item and change the property "Filename" to the name of
Oracle Graphics saved on step 1 (like sal.ogd);
Build a "push button" on canvas to refress the graphics with actual parameter o
new parameter, on "push button" change the property Label to "Refresh", and create a
trigger "when-button-pressed" with this code:
declare pl_id ParamList; pl_name VARCHAR2(10) := 'tempdata'; BEGIN pl_id :=
Get_Parameter_List(pl_name); IF not Id_Null(pl_id) THEN
destroy_parameter_list(pl_id); end if; pl_id := Create_Parameter_List(pl_name); /*Now
add a parameter to pass to graphics*/
Add_Parameter(pl_id,'PR_SAL',TEXT_PARAMETER,to_char(:block1.pr_sal)); /*if need
more parameters, use more Add_parameter to list*/ /*now, call the graphics sal.ogd file
to show on especified chart_area and with a parameter list*/
OG.open('sal.ogd','block1.chart_area1',FALSE,TRUE,pl_id);
OG.close('sal.ogd','block1.chart_area1'); END;
[edit]
Run the forms
Run the forms, enter a value on parameter SAL and push the button, the graphics
show the values! Change de parameter SAL and clic on button, the Graphics will be
refresh with new values!!!
[edit]
Conclusion
Now, you can build new graphics with more parameters, you can build a graphics with
one or more charts items!
You can build a graphics with on chart, and when the user click on a "bar" you call
another chart with anothers values (See Drill Down and Drill up).
Default: none
Example:
GRAPHICS60_PATH=C:\oracle\apps\graphics;C:\myfiles
This parameter specifies the search path for files used in a Graphics runtime application.
These include display files (.ogr), images, external queries, and other objects that the
application attempts to load from a file at runtime. For example, if you import the image file
scooter.tif, Graphics Builder searches in the directories specified by GRAPHICS60_PATH to find
that file.
GRAPHICS60_PATH can specify multiple directories. Use a backslash (\) to separate directories
in a path, and a semicolon (;) to separate complete paths.