Home » Developer & Programmer » Forms » How to SetSourceData into excel.chart in form6i (excel 2000, form6i, window 2000)
How to SetSourceData into excel.chart in form6i [message #309620] Fri, 28 March 2008 03:29 Go to next message
tony2008
Messages: 4
Registered: March 2008
Junior Member
Embarassed
Re: How to SetSourceData into excel.chart in form6i [message #309634 is a reply to message #309620] Fri, 28 March 2008 04:17 Go to previous messageGo to next message
tony2008
Messages: 4
Registered: March 2008
Junior Member
I can use ole2 to create excel chart in form6I,when I want to SetSourceData into excel.chart,the is no result from the program.

DECLARE
w_excelapp OLE2.OBJ_TYPE;
w_workbooks OLE2.OBJ_TYPE;
w_workbook OLE2.OBJ_TYPE;
w_worksheet OLE2.OBJ_TYPE;
w_workcharts OLE2.OBJ_TYPE;
w_workchart OLE2.OBJ_TYPE;

w_arg OLE2.LIST_TYPE;
w_arg_list OLE2.LIST_TYPE;
BEGIN
w_excelapp := OLE2.CREATE_OBJ('EXCEL.APPLICATION');
OLE2.SET_PROPERTY(w_excelapp, 'DISPLAYALERTS', 'FALSE');

w_workbooks:= OLE2.GET_OBJ_PROPERTY(w_excelapp, 'WORKBOOKS');
w_workbook := OLE2.GET_OBJ_PROPERTY(w_workbooks, 'ADD');
w_arg := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(w_arg, 1);
w_worksheet:=OLE2.GET_OBJ_PROPERTY(w_workbook, 'WORKSHEETS', w_arg);
OLE2.DESTROY_ARGLIST(w_arg);

w_workcharts:=OLE2.GET_OBJ_PROPERTY(w_workbook,'CHARTS');
w_workchart := ole2.Invoke_obj(w_workcharts, 'Add');
OLE2.SET_PROPERTY(w_workchart, 'NAME', 'CBA');

-----------------------------------------------------------------
--the is no result in this part
w_arg_list := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(w_arg_list, 'Sheets("Sheet1").Range("A1:E7")');
OLE2.ADD_ARG(w_arg_list, 'xlColumns');
OLE2.INVOKE(w_workchart, 'SetSourceData', w_arg_list);
OLE2.DESTROY_ARGLIST(w_arg_list);
-----------------------------------------------------------------

w_arg := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(w_arg, 'C:\1.XLS');
OLE2.INVOKE(w_workbook, 'SAVEAS', w_arg);
OLE2.DESTROY_ARGLIST(w_arg);

IF w_worksheet IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_worksheet);
END IF;

IF w_workchart IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workchart);
END IF;

IF w_workcharts IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workcharts);
END IF;

IF w_workbook IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workbook);
END IF;
IF w_workbooks IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workbooks);
END IF;
IF w_excelapp IS NOT NULL THEN
OLE2.INVOKE(w_excelapp, 'QUIT');
OLE2.RELEASE_OBJ(w_excelapp);
END IF;
END;
Re: How to SetSourceData into excel.chart in form6i [message #309811 is a reply to message #309634] Sat, 29 March 2008 01:03 Go to previous messageGo to next message
tony2008
Messages: 4
Registered: March 2008
Junior Member
Who can help me
Re: How to SetSourceData into excel.chart in form6i [message #309981 is a reply to message #309811] Sun, 30 March 2008 19:05 Go to previous messageGo to next message
tony2008
Messages: 4
Registered: March 2008
Junior Member
Confused up
Re: How to SetSourceData into excel.chart in form6i [message #310015 is a reply to message #309981] Sun, 30 March 2008 23:50 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Look at:
Working with Excel via OLE2
http://www.orafaq.com/forum/t/72811/67467/
http://www.orafaq.com/forum/m/84230/67467/
Merge two cells in Excel using ole2
http://www.orafaq.com/forum/t/77825/67467/
Error closing Excel file generated using OLE2
http://www.orafaq.com/forum/t/77351/67467/
How to wrap text in excel cell using ole2
http://forums.oracle.com/forums/thread.jspa;jsessionid=8d92200830d62336f40f5aad44efb36ee981f4e6c19e.e34QbhuKaxmMai0MaNeMb3eKb390?mess ageID=1242535&#1242535
Excel via DDE
http://www.orafaq.com/forum/m/260061/67467/#msg_260061
Import from Excel
http://www.orafaq.com/forum/mv/msg/32353/86299/67467/#msg_86299
Forms to Excel example with webutil
http://forums.oracle.com/forums/thread.jspa?messageID=1430799
Another Forms to Excel example
http://www.orafaq.com/forum/t/81537/67467/
How to kill EXCEL.exe from Task Manager from Oracle Forms
http://www.orafaq.com/forum/t/88643/67467/
how do i display all excel worksheets name in form
http://www.orafaq.com/forum/t/89775/67467/
More Excel stuff
http://www.orafaq.com/forum/t/90502/67467/
To run an excel macro
http://www.orafaq.com/forum/t/47685/67467/
Worked example for using Excel through ODBC
http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:4406709207206#18830681837358

David
Re: How to SetSourceData into excel.chart in form6i [message #313267 is a reply to message #310015] Fri, 11 April 2008 05:03 Go to previous messageGo to next message
czhtony2008
Messages: 13
Registered: April 2008
Junior Member
this question is solved

PROCEDURE p_add_workchart(form_workbook IN OUT OLE2.OBJ_TYPE,
form_workchart IN OUT OLE2.OBJ_TYPE,
form_chartname VARCHAR2,
form_charttype NUMBER,
form_chartsource VARCHAR2) IS
w_workcharts OLE2.OBJ_TYPE;
w_seriescollection OLE2.OBJ_TYPE;
w_series OLE2.OBJ_TYPE;
w_args OLE2.LIST_TYPE;
w_Legend OLE2.OBJ_TYPE;
BEGIN
w_workcharts := OLE2.GET_OBJ_PROPERTY(form_workbook, 'CHARTS');
--FIRST RELEASE THE OBJECT
IF form_workchart IS NOT NULL THEN
OLE2.RELEASE_OBJ(form_workchart);
END IF;
form_workchart := ole2.Invoke_obj(w_workcharts, 'Add');

OLE2.SET_PROPERTY(form_workchart, 'NAME', form_chartname);
OLE2.SET_PROPERTY(form_workchart, 'ChartType', form_charttype);

w_seriescollection := OLE2.INVOKE_OBJ(form_workchart, 'SeriesCollection');
w_args:=OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(w_args, form_chartsource);
OLE2.ADD_ARG(w_args, 2 );
OLE2.ADD_ARG(w_args, 0 );
OLE2.ADD_ARG(w_args, 1 );
OLE2.ADD_ARG(w_args, 0 );
OLE2.INVOKE(w_seriescollection,'Add', w_args);
OLE2.DESTROY_ARGLIST(w_args);

OLE2.SET_PROPERTY(form_workchart, 'HasLegend', 1);

w_Legend := OLE2.GET_OBJ_PROPERTY(form_workchart, 'Legend');
OLE2.SET_PROPERTY(w_Legend, 'Position', -4107);

IF w_Legend IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_Legend);
END IF;

IF w_series IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_series);
END IF;

IF w_seriescollection IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_seriescollection);
END IF;

IF w_workcharts IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workcharts);
END IF;

EXCEPTION WHEN OLE2.OLE_ERROR THEN
p_show_ole_err;
IF w_series IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_series);
END IF;
IF w_seriescollection IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_seriescollection);
END IF;
IF w_workcharts IS NOT NULL THEN
OLE2.RELEASE_OBJ(w_workcharts);
END IF;
END;
Re: How to SetSourceData into excel.chart in form6i [message #514950 is a reply to message #309620] Thu, 07 July 2011 08:05 Go to previous message
randriana
Messages: 18
Registered: September 2010
Junior Member
IS anyone can help me i would like to generate a excel file like the file attached.
Thanks.
  • Attachment: nd_jpg.JPG
    (Size: 87.78KB, Downloaded 984 times)
Previous Topic: Problem with a template word and client_ole2
Next Topic: insert records which are checked
Goto Forum:
  


Current Time: Thu Apr 25 17:20:08 CDT 2024