You are on page 1of 1

Solved:

Just Follow these steps:


Create chart in Graphics Builder.
Open Oracle Forms builder, connect with a database user(like scott/tiger), then create a new "Forms"(CTRL+N)
Attach on this forms the libraries OG.PLL (see Object Navigator node "Attached 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);
and use this code on when_button_pressed. or when_new_form_instance.

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;

you can now show any graph on forms.

You might also like