plzzz help me [message #120467] |
Thu, 19 May 2005 23:57 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
toufiq_raja
Messages: 39 Registered: May 2005 Location: Islamabad
|
Member |
![bagirbilla%40yahoo.com](/forum/theme/orafaq/images/yahoo.png)
|
|
can any buddy send me fmb file having example of sendig data from form 6i to excel...
i have checked different codes and package, but they contain some errors!
i need it !
|
|
|
Re: plzzz help me - Calling Excel from Forms 6i C/S [message #120607 is a reply to message #120467] |
Fri, 20 May 2005 15:08 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
danosw
Messages: 20 Registered: May 2005 Location: California
|
Junior Member |
|
|
Call this procedure from your form and it will start excel and put 'My Excel' into cell A2.
PROCEDURE test IS
i_reporttitle VARCHAR2(200) := 'My excel';
i_orientation VARCHAR2(200) := '1';
/* definiton for commonly used variables and constants and exceptions */
ExcelID ole2.obj_type;
ExcelWorkBooksID ole2.obj_type;
ExcelWorkBookID ole2.obj_type;
ExcelWorkSheetsID ole2.obj_type;
ExcelWorkSheetID ole2.obj_type;
ExcelCellID ole2.obj_type;
ExcelFontID ole2.obj_type;
ExcelPageSetupID ole2.obj_type;
ExcelArgs ole2.list_type;
BEGIN
ExcelID := ole2.create_obj('Excel.Application');
ExcelWorkBooksID := ole2.get_obj_property(ExcelID, 'Workbooks');
ExcelWorkBookID := ole2.invoke_obj(ExcelWorkBooksID, 'Add');
ExcelWorkSheetsID := ole2.get_obj_property(ExcelWorkBookID, 'Worksheets');
ExcelWorkSheetID := ole2.invoke_obj(ExcelWorkSheetsID, 'Add');
ExcelPageSetupID := ole2.get_obj_property(ExcelWorkSheetID, 'PageSetup');
ole2.set_property(ExcelPageSetupID, 'Orientation',i_orientation);
ole2.release_obj(ExcelPageSetupID);
ExcelArgs := ole2.create_arglist;
ole2.add_arg(ExcelArgs,2);
ole2.add_arg(ExcelArgs,1);
ExcelCellId := ole2.get_obj_property(ExcelWorkSheetId,'Cells',ExcelArgs);
ole2.destroy_arglist(ExcelArgs);
ole2.set_property(ExcelCellId, 'Value', i_reporttitle);
ExcelFontId := ole2.get_obj_property(ExcelCellId, 'Font');
ole2.set_property(ExcelFontId, 'Bold', 'True');
ole2.set_property(ExcelFontId, 'Size', '20');
ole2.release_obj(ExcelFontId);
ole2.release_obj(ExcelCellId);
ole2.set_property(ExcelID, 'Visible','TRUE');
-- ... and release the allocated resources because they are no longer used by forms
ole2.release_obj(ExcelWorkSheetID);
ole2.release_obj(ExcelWorkSheetsID);
ole2.release_obj(ExcelWorkBookID);
ole2.release_obj(ExcelWorkBooksID);
ole2.release_obj(ExcelID);
END;
|
|
|
|