|
Не работает процедура обработки файла Excel средставами Oracle Forms 10g
|
|||
---|---|---|---|
#18+
Доброго вечера всем ! Следующая проблема нужно прочитать данные из выбранного файла Excel из процедуры Oracle Forms 10g, есть следующий код Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26.
Модератор: Тема перенесена из форума "Oracle". ... |
|||
:
Нравится:
Не нравится:
|
|||
02.11.2011, 14:23 |
|
Не работает процедура обработки файла Excel средставами Oracle Forms 10g
|
|||
---|---|---|---|
#18+
Дополнение к вопросу запускается приложение под Windows7, после запуска приложения и исполнения оператора Код: plaintext 1.
... |
|||
:
Нравится:
Не нравится:
|
|||
03.11.2011, 13:37 |
|
Не работает процедура обработки файла Excel средставами Oracle Forms 10g
|
|||
---|---|---|---|
#18+
NVART_FOXДополнение к вопросу запускается приложение под Windows7, после запуска приложения и исполнения оператора Код: plaintext 1.
извиняюсь строчка кода конечно App := OLE2.CREATE_OBJ('Excel.APPLICATION'); ... |
|||
:
Нравится:
Не нравится:
|
|||
03.11.2011, 13:39 |
|
Не работает процедура обработки файла Excel средставами Oracle Forms 10g
|
|||
---|---|---|---|
#18+
NVART_FOX, Помнится мне, кгода несколько лет назад развлекался с 10 формсами, OLE на клиентской машине нужно было пользовать при помощи пакета CLIENT_OLE2 (OLE2 производил все действия на сервере приложений). Не в этом ли дело? ... |
|||
:
Нравится:
Не нравится:
|
|||
15.11.2011, 14:21 |
|
Не работает процедура обработки файла Excel средставами Oracle Forms 10g
|
|||
---|---|---|---|
#18+
from support.oracle 1. Download the excel_read.zip a. create_planets.sql b. planets_ole_excel_read.fmb c. planets.xls 2. Run create_planets.sql to create the DB table that will be used to save the Excel data from the Form. 3. Ensure that your environment is set up to run Webutil. If you don't have Webutil working, ensure you get it functioning first. Also, recommend getting the WebUtil Demo Form (wu_test_106) functioning to verify setup is correct. webutil-106-130517.zip 4. Place 'planets.xls' in your d: drive on the client PC where you will be running the form. The 'planets_ole_excel_read form' is hard coded to look for planets.xls in d: If you need to place it elsewhere you will need to modify the code in the 'Read from Excel' button. 5. Use the Forms Compiler (frmcmp) to create 'planets_ole_excel_read.fmx. Ensure that the 'COMPILE_ALL=YES' option is chosen. 6. Run the Form from the client machine and push the 'Read from Excel' button. The data will be read from the Excel Spread sheet into the Form. You can then commit it to the DB. Here is the code behind the button with some explanatory remarks: DECLARE application Client_OLE2.Obj_Type; workbooks Client_OLE2.Obj_Type; workbook Client_OLE2.Obj_Type; worksheets Client_OLE2.Obj_Type; worksheet Client_OLE2.Obj_Type; cell Client_OLE2.OBJ_TYPE; args Client_OLE2.OBJ_TYPE; cell_value varchar2(100); eod boolean:=false; j integer:=1; BEGIN -- The following set up communication with the excel spreadsheet application := Client_OLE2.create_obj('Excel.Application'); Client_OLE2.set_property(application,'Visible','false'); workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks'); args := Client_OLE2.CREATE_ARGLIST; Client_OLE2.add_arg(args,'d:\planets.xls'); --modify this for diff location workbook := Client_OLE2.GET_OBJ_PROPERTY(workbooks,'Open',args); Client_OLE2.destroy_arglist(args); worksheets := Client_OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets'); worksheet := Client_OLE2.GET_OBJ_PROPERTY(application,'activesheet'); --Go to the first record go_block('planets'); first_record; loop If :system.record_status <> 'NEW' then create_record; end if; exit when eod; for k in 1..3 loop --3 fields per record args:= Client_OLE2.create_arglist; Client_OLE2.add_arg(args, j); Client_OLE2.add_arg(args, k); cell:= Client_OLE2.get_obj_property(worksheet, 'Cells', args); Client_OLE2.destroy_arglist(args); cell_value :=Client_OLE2.get_char_property(cell, 'Value'); if upper(cell_value) = 'EOD' then --End of Data marker in Spread sheet. eod:=true; --set the Boolean for end of data. Message('End of Data'); exit; end if; --Fill the fields with the cell values copy(cell_value,name_in('system.cursor_item')); next_item; --get next field ready to receive end loop; --for j:=j+1; end loop;--main loop -- Release the Client_OLE2 object handles Client_OLE2.release_obj(cell); Client_OLE2.release_obj(worksheet); Client_OLE2.release_obj(worksheets); Client_OLE2.release_obj(workbook); Client_OLE2.release_obj(workbooks); Client_OLE2.invoke(application,'Quit'); Client_OLE2.release_obj(application); END; ..ещё посмотри http://sites.google.com/site/jvrexcelproject/version-1-5-2-english - использование .jar для чтения/записи Excel сам не пользовался, ибо все отчеты либо html/pdf .. так что если получится, отпишись.. ... |
|||
:
Нравится:
Не нравится:
|
|||
16.11.2011, 09:01 |
|
|
start [/forum/topic.php?fid=51&msg=37577644&tid=1878583]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
49ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
45ms |
get tp. blocked users: |
1ms |
others: | 314ms |
total: | 452ms |
0 / 0 |