WebUtil client_ole2 commands in Oracle Forms 10g

5 pts.
Tags:
Excel 2007
Mailmerge
Oracle Forms 10g
WebUtil
Word 2007
I want to attach a sheet from an excel 2007 datasource to a word 2007 mailmerge using webutil client_ole2 commands in oracle forms 10g

Answer Wiki

Thanks. We'll let you know when a new response is added.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • adougui
    I WANT TO LOAD EXCEL FILE INTO ORACLE FORMS 10G DATABASE. FROM THE SERVER BUT I HAVE GOT A MISTAKE LIKE : Oracle.forms.webutil.ole.OLeFunctions bean not found and when I click on OK i have got an error FRM-4075 exception ORA-305500.Here is my code :

    PROCEDURE PROC_ENTETE_BORDEREAU IS

    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;
    worksheet2    Client_OLE2.Obj_Type;
    cell Client_OLE2.OBJ_TYPE;
    args Client_OLE2.OBJ_TYPE;
    cell_value varchar2(100);
    num_wrkshts NUMBER;
    wksht_name VARCHAR2(250);
    eod boolean:=false;
    integer:=2; 
    v_fName VARCHAR2(450);
    BEGIN 
    -- Get the name of the file to open
    --v_fName := 'D:\MyDevelopment\Forms\Samples\WebUtil\Read_Excel\planets3.xls';
    v_fName := WebUtil_File.File_Open_Dialog(
    directory_name => 'C:\'
    --,file_name => Get_Form_Property(:System.Current_form,Form_Name)||'.xls'
    ,File_Filter => null
    ,Title => 'Select Client filename to Open.'
    );
    :global.filename:=v_fName;
    IF ( v_fName IS NOT NULL ) THEN 
    -- The following sets up communication with the excel spreadsheet
    -- --------------------------------------------------------------
    -- Open the OLE application
    application := Client_OLE2.create_obj('Excel.Application'); 
    -- Keep the application hidden
    Client_OLE2.set_property(application,'Visible','false');
    workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
    args := Client_OLE2.CREATE_ARGLIST;
    -- Open the selected File
    -- ----------------------
    Client_OLE2.add_arg(args,v_fName); 
    workbook := Client_OLE2.GET_OBJ_PROPERTY(workbooks,'Open',args);
    Client_OLE2.destroy_arglist(args);
    worksheets := Client_OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
    -- Get number of worksheets
    -- ------------------------
    num_wrkshts := Client_OLE2.GET_NUM_PROPERTY(worksheets, 'Count');
    worksheet := Client_OLE2.GET_OBJ_PROPERTY(application,'activesheet');
    --Go to the first record
    go_block('TEMP_INFO_BORDEREAU'); 

    last_record; 
    loop
    If :system.record_status <> 'NEW' then
             create_record;
    end if;
    exit when eod;
    for k in 1..11 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
    eod:=true;
    -- Message('End of Data');
    exit;
    end if;
    --Could be done this way also -> 
    /*if k =1 then
    :dept.deptno:=cell_value;
    end if;
    if k =2 then
    :dept.dname:=cell_value;
    end if;
    if k =3 then
    :dept.loc:=cell_value;
    end if;
    */
    --Less code this way ->
    copy(cell_value,name_in('system.cursor_item'));
    next_item;
    end loop; --for
    j:=j+1;
    end loop;--main loop
    go_block('TEMP_INFO_BORDEREAU'); 
    previous_record;
    -- Release the Client_OLE2 object handles
    IF (cell IS NOT NULL) THEN 
    Client_OLE2.release_obj(cell);
    END IF;
    IF (worksheet IS NOT NULL) THEN 
    Client_OLE2.release_obj(worksheet);
    END IF;
    IF (worksheets IS NOT NULL) THEN 
    Client_OLE2.release_obj(worksheets);
    END IF;
    IF (worksheet2 IS NOT NULL) THEN 
    Client_OLE2.release_obj(worksheet2);
    END IF;
    IF (workbook IS NOT NULL) THEN 
    Client_OLE2.release_obj(workbook);
    END IF;
    IF (workbooks IS NOT NULL) THEN 
    Client_OLE2.release_obj(workbooks);
    END IF;
    Client_OLE2.invoke(application,'Quit');
    Client_Ole2.destroy_arglist(args);-------
    Client_OLE2.release_obj(application);
    ELSE
    Message('Aucun fichier n''a été selectionné');
    message(' ');
    RAISE Form_Trigger_Failure;
    END IF;


    END; 


    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: