Webutil_file.file_save_dialog

i use
webutil_file.file_save_dialog(null,fileName,null,'Save')
i save a document from db to client.
the fileName i read from the database.
when i open the file_save_dialog the fileName is displayed as default. but when i want to save it somewhere else by browsing the filesystem, the filename is lost.
whick means: when clicking a folder in the file_save_dialog the filename-field becomes the directory-name.
is this normal? how can i keep the filename in the filename-field in a file_save_dialog?

This is actually an underlying bug in Java - it's fixed in Java 1.4 so when you go to that version you'll get it for free.

Similar Messages

  • WEBUTIL FILE_SAVE_DIALOG BUG

    This is more untested code than a bug.
    I am using WEBUTIL_FILE.FILE_SAVE_DIALOG in my form to download a file from the database onto client machine.
    When the file dialog comes up and the user clicks on a directory to save to, the File Name field gets replaced with the directory name. In other words, file dialog assumes that the user wants to rename the file as "Desktop". Instead of saving the file (say photo.gif) into c:\...\Desktop\photo.gif, it creates a file called "Desktop". In the windows environment, the File Name field does not change with every click of the button. Does anyone have a workaround to stop the File Name field from changing when the user clicks on a directory?
    Thanks.
    kh

    this is a "bad" behaviour, but actually it is.
    Years ago I think, there were the same limitations in d2kwutil. Other non-oracle-tools have the same problem. I'm sure, that this will be corrected in the next versions.
    Gerd

  • EXPORT to text or CSV format from a form

    Dear all,
    Could you please help me to export the data from my form to a text file or to a csv format. I am very new to forms.
    i need to export the data from the oracle form to a text file or CSV file format.
    I had created form named as form1.
    In form1 i have a block named as block1. In this block i have 4fields as field1, field2, field3, field4. using a tabe1 which has the same 4fields.
    This form is in tabular form.
    Example:
    In the form i have data like as below and i got this data from table1. I used a execute query to get the data from the table into this form.
    field1 field2 field3 field4
    raj 1234 abc 510
    dil 777 hi 787
    Now my requirement is i need to export this data into a file, when i click on a button(Export) it has to browse for a folder on my desktop and i have to name the filename to save the data.
    Please help me.
    Thanks in advance.

    This should be almost same as in your previous task for import data.
    Try this:
    DECLARE
       v_file_name   VARCHAR2 (100);
       v_file        client_text_io.file_type;  
       v_delimiter VARCHAR2(1) := ',';
    BEGIN
       v_file_name := webutil_file.file_save_dialog;
       v_file := client_text_io.fopen (v_file_name, 'w');
       GO_BLOCK ('block1');  
       FIRST_RECORD;
       LOOP
            client_text_io.PUT_LINE(v_file, :block1.field1||v_delimiter||:BLOCK1.field2||v_delimiter||:BLOCK1.field3||v_delimiter||:BLOCK1.field4);
        IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
             EXIT;
        END IF;     
        NEXT_RECORD;
       END LOOP;
       client_text_io.fclose (v_file);
    END;

  • Pl/sql to extract data  with form: extract data is a text file

    Hi dear all,
    to be straightforward here is the problem: we currenlty developing with oracle tools :" Developer Suite 10g version 10.1.2.0.2" an interface .
    Using oracle forms, we would like to program a command button that will be in charge of pooling the data from the database and offer the client to save it on his desktop. The extracted data should be a one single flat text file having a one single continuous row. and the data extracted are from a 10 g database( one table having one column(varchar2(240); and 192 rows );
    attached with this mail is ou current script link with the command " when-button-pressed"
    PROCEDURE EXTRACTION_FICHIER_FIC_BDF IS
    n_bouton number;
    LF$File CLIENT_TEXT_IO.FILE_TYPE;
    LC$Name Varchar2(100) ;
    LC$Fic Varchar2(100) ;
    LN$Lines Pls_integer := 0 ;
    LC$Line Varchar2(4000) ;
    -- cursor --
    Cursor C_CUR Is
    SELECT ENREGISTREMENT_BDF
    FROM ops$admO7.fic_bdf
    ORDER BY 1;
    BEGIN
    LC$Name := 'd:\AA1217.bdf';
    LC$Fic := WEBUTIL_FILE.FILE_SAVE_DIALOG
    'd:\',
    LC$Name,
    'Choisir l''emplacement du fichier à sauvegarder'
    If LC$Fic is null Then
    Return ;
    End if ;
    -- Open the file --
    Begin
    LF$File := CLIENT_TEXT_IO.FOPEN( LC$Fic, 'W');
    Exception
    when others then
    message( 'OPEN FILE ERROR ' || LC$Fic );
    raise form_trigger_failure;
    End ;
    -- Write the lines --
    For Cur In C_CUR Loop
    LC$Line := Cur.ENREGISTREMENT_BDF;
    CLIENT_TEXT_IO.PUT_LINE( LF$File, LC$Line ) ;
    LN$Lines := C_CUR%ROWCOUNT ;
    End loop ;
    -- Close the file --
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
    set_alert_property('AL_MESSAGE',alert_message_text,'Export terminé avec succès');
    n_bouton :=show_alert('AL_MESSAGE');
    synchronize ;
    Exception
    When form_trigger_failure Then
    CLIENT_TEXT_IO.FCLOSE( LF$File ) ;
    Raise ;
    END;
    thanks if advance !!!!!

    Hello,
    what's your problem with this? You posted a lot of useful information like version infos and code (Hint: when you post code you can do this with the tags so it gets formated), but I cannot see what exactly is failing or behaving unexpected, so you might share that too ;)
    cheers                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How To Call Save As Dialog?

    Dear All,
    I have OAS Forms And Report Services10g(9.0.4) on Window 2000 & service pack 4 And 10g Developer Suit.
    To deploy application on web..
    How can I call "Save As Dialog" to save a file on the user's machine through When_Buton_Pressed trigger. The file was generated by the database.
    Any help will be nice.
    Thanks

    Thanks for code
    but when i place on when button trigger it gives this error dialog
    Oracle.forms.webutil.file.FileFunctions bean not found.
    WEBUTIL_FILE.FILE_SELECTION_DIALOG_INT will not work.
    the code was
    Declare
    LC$Target Varchar2(256) := 'text.txt' ; -- file name
    LC$Fic Varchar2(256) ;
    Begin
    LC$Fic := WEBUTIL_FILE.FILE_SAVE_DIALOG
    'D:\',
    LC$Target,
    'Sélectionner un fichier'
    If LC$Fic is null Then
    Return ; --// end user has pressed cancel
    End if ;
    End;
    help needed & Please tell me How can i verify that mine installation & configuration of webtill is correct.
    Thanks
    Rana Adnan

  • Webutil_host command

    Hi,
    I want to achieve the following using webutil:
    Download a pdf file stored as blob in database via db_to_client_with_progress and save it on the client using File_save_dialog. This works o.k.
         myfilename := webutil_file.file_save_dialog('c:\',null,'PDF|*.pdf','Save attachment...');
    r_download :=webutil_file_transfer.db_to_client_with_progress(myfilename,'SEMATT','DOCUMENT','id = '||:sematt.id,'Downloading...','File download in progress...');
    This works, and I can open that file manually using acrobat reader.
    Now I want to open the pdf file using webutil_host.host command:
    webutil_host.host(myfilename);
    This does not work. Even
    webutil_host.host('acrord32 '||myfilename);
    does not work.
    Any help is appreciated!
    Thanks
    Gerald Krieger

    Is the important part of this process the download or the open? Because you could open the PDF from the server using web.show_document. But if you do want to call it from the client then you need to use CMD in the WEBUTIL_HOST call - something like CLIENT_HOST('cmd /c acrord32 '||myfilename);
    Cheers, APC

  • To upload and download

    i hv 2 buttons one for upload and another for download
    through webutil
    i hv written this code but it is not inserting record into the table, thr r no records in the table, it is empty, when i try to upload .txt file it is showing me an error "missing expression" ORA-00936
    the code is
    declare
    sMY_file varchar2(200);
    v_Last_Directory      Varchar2(2000);
    v_Upload_Succes     boolean;
    nWHERE          number(10);
    OUT_DOC_ID number;
    temp_id number;
    doc_id_temp number;
    v_status VARCHAR2(200);
    BEGIN
    OUT_DOC_ID:=:parameter.p_dealid; --:files.deal_id;
         sMY_file := WebUtil_File.File_save_Dialog(v_Last_Directory,
         'test',
         '|All Files|*.*|',
         'Select a file');
    if OUT_DOC_ID is not null then
    v_Upload_Succes := WebUtil_File_Transfer.Client_to_db(sMY_file,
    'deal_document_file', -- TABLE name
    'CONTENT' , -- columname
    'deal_id||='||OUT_DOC_ID ||' and document_file_name='||:files.document_file_name -- where          
    elsif OUT_DOC_ID is null then
         v_status := get_block_property('files',status);
    temp_id:=get_id;
    :files.deal_id:=temp_id;
    :files.document_file_name:= substr(sMY_file,instr(sMY_file,'\',-1)+1);
         insert into deal_document_file (deal_id,document_file_name) values
    (:files.deal_id, :files.document_file_name);
         commit;
         v_Upload_Succes := WebUtil_File_Transfer.Client_to_db(     sMY_file,
    'deal_document_file', -- TABLE name
         'CONTENT' , -- columname
         'deal_id='||:files.deal_id||' and document_file_name='||:files.document_file_name
    end if;     
    commit;
    if (v_Upload_Succes) then
         :files.maker:= sysuser;
         :files.made_at:=sysdate;
    end if;
    end;
    commit;
    could anybody help me in this.

    No, the form is not fine else you would not have this FRM error message.
    Check the syntax of the parameters given to the WebUtil_File_Transfer.Client_to_db() Webutil function. add a message() instruction just after to see if the function if well executed.
    Francois

  • Using webutil causes focus issues

    Hello,
    Many of us are familiar with the sporadic focus issue that can occur whereby you can use the keyboard to tab around a form but not the mouse. We have an existing function in our application which uses calls to Webutil functions (WEBUTIL_FILE.FILE_SAVE_DIALOG, WEBUTIL_FILE_TRANSFER.IS_AS_READABLE, EBUTIL_FILE_TRANSFER.AS_TO_CLIENT) to mediate a CSV export of data. We've noticed, since upgrading to 10.1.2.3 and the Sun JVM, that after performing this action, the focus problems occur i.e. mouse navigation no longer works.
    Has anyone else encountered this problem..? Or even better, have a suggested solution?
    Regards,
    James
    Apps Server: Forms and Reports Server 10.1.2.3
    JVM: Sun 1.6.0_14

    I face this problem and finally get the the solution it is:
    1- make keyboard navigable property for the blob item 'no' .
    2- create any item in the block of this blob and make it navigable 'yes' and visible 'yes' and width '0' and height '0'.
    and try and isa mouse navigation will work
    Feel free to contact me to inquire anything .

  • Catching webutil exception

    Hi all,
    I am using Webutil library within form10g, the problem that i got is that when the user clicks cancel to save a file, the non-oracle 302000.
    the code where the error apears is this:
    fic_name := WEBUTIL_FILE.FILE_SAVE_DIALOG('',fic_name,'csv files(*.csv)|*.csv|',Save File');
    If the user clicks to save the file, everything goes perfect, but if he clicks 'Cancel', then the error appears.
    thx in advance!

    Hi,
    I am using Webutil library within form10g, the problem that i got is that when the user clicks cancel to save a file, the non-oracle 302000.the code where the error apears is this:
    fic_name := WEBUTIL_FILE.FILE_SAVE_DIALOG('',fic_name,'csv files(*.csv)|*.csv|',Save File');If the user clicks to save the file, everything goes perfect, but if he clicks 'Cancel', then the error appears.
    >
    It is not that line but how you handle the cancel event after this line that counts.
    Do you have a line similar to the one below to deal with cancel button clicked event?
    if fic_name is null then .... -- this condition catches No file was selected or Cancel was clicked event.If not, time you added it and handled the Cancel button processing on that condition.
    Cheers,

  • Browse option --

    Hi,
    Is there any way to change the look of browse option window?[am using WEBUTIL_FILE.FILE_SAVE_DIALOG method]
    Regards
    Priya

    You can write your own Java Bean to do what WebUtil does. Add your own customizations.
    http://java.sun.com/developer/JDCTechTips/2004/tt0316.html
    http://java.sun.com/docs/books/tutorial/uiswing/components/filechooser.html

  • Win_api_dialog

    Hello,
    Can anyone tell me, if there is a substitute for win_api_dialog.save_file in webutil?
    Thanks in advanced
    JA

    Hello,
    Webutil_File.FILE_SAVE_DIALOG()Francois

  • Error when calling webutil functions in a library.

    I have installed and configured webutil on my Linux machine and I can successfully run the webutil_demo.
    I have a form with webutil library attached and object group added calling webutil_file.File_save_dialog successfully.
    But when I want another form to a procedure in a PL/SQL library (pll_window.pll ) which call webutil_file_transfer.as_to_client,, It reports an error saying
    The WEBUTIL object group is not available in this Form. WebUtil cannot work
    and pop out a small alert "Please acknowledge"
    When I click OK, it says FRM_40734: Internal Error: PL/SQL error occurred
    So what might be the problem ? I had webutil.pll attached to my library file pll_window.pll also.

    frank1018 wrote:
    I have installed and configured webutil on my Linux machine and I can successfully run the webutil_demo.
    I have a form with webutil library attached and object group added calling webutil_file.File_save_dialog successfully.
    But when I want another form to a procedure in a PL/SQL library (pll_window.pll ) which call webutil_file_transfer.as_to_client,, It reports an error saying
    The WEBUTIL object group is not available in this Form. WebUtil cannot work
    and pop out a small alert "Please acknowledge"
    When I click OK, it says FRM_40734: Internal Error: PL/SQL error occurred
    So what might be the problem ? I had webutil.pll attached to my library file pll_window.pll also.Do you subclass from webutil.olb to your form ?
    Hope this helps

  • Save as.. in Forms

    How can I save files to the client station without using the webutil (webutil_file.file_save_dialog) ? I must not use the webutil.
    I saw a possibility to use beans in Forms. There is anybody how made a model with beans for saving files and after that to build a JAR using the following exemple ?
    http://forms.pjc.bean.over-blog.com/categorie-453384.html
    Thank you.

    I want to save files (generated with utl_file) to client station and for that I must build a Java class (like in the example) . After that I must build the JAR file ...deployed to the ../forms/java.... call from Forms...
    There is another method to save files to client in Forms (without using the webutil) ?
    Thanks

  • Webutil to export to Excel

    Forms: Forms [32 Bit] Version 10.1.2.3.0 (Production)
    current Code
    procedure dx is
    l_filename varchar2(200);
    FLAG BOOLEAN;
    directory_name varchar2(200);
    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;
    args Client_OLE2.List_Type;
    cell ole2.Obj_Type;
    j INTEGER;
    k INTEGER;
    v_rec_vw emp%rowtype;
         CURSOR x_cur IS
              SELECT emp_id,
    dept_id,
    name,
    job_title
              FROM  emp;
    begin
    l_filename := webutil_file.file_save_dialog
    (directory_name => 'C:\'
    ,file_name => 'summary'||sysdate||'.xls'
    ,file_filter => null
    ,title => 'Select client side filename where App Server file will be saved'
    /* Calling Excel and adding a new worksheet to a blank workbook */
    application := Client_OLE2.create_obj('Excel.Application');
    CLIENT_OLE2.SET_PROPERTY(APPLICATION, 'VISIBLE', false);
    workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
    workbook := Client_OLE2.Invoke_Obj(workbooks, 'Add');
    worksheets := Client_OLE2.Get_Obj_Property(workbook, 'Worksheets');
    worksheet := Client_OLE2.Invoke_Obj(worksheets, 'Add');
    --go_block('MASTER');
    j:=1;
    k:=1;
    for k in 1..21 /* Table has 246 columns */
    loop
    for x_rec in x_cur loop
    --If not name_in(:system.cursor_item) is NULL Then
    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);
    --Client_OLE2.set_property(cell, 'Value', name_in(:system.cursor_item));
    Client_OLE2.set_property(cell, 'Value', name_in(x_rec.prs_id));
    Client_OLE2.release_obj(cell);
    --End If;
    end loop;
    next_item;
    end loop;
    Client_OLE2.Release_Obj(worksheet);
    Client_OLE2.Release_Obj(worksheets);
    /* Save the Excel file created */
    args := Client_OLE2.Create_Arglist;
    Client_OLE2.Add_Arg(args,l_filename);
    Client_OLE2.Invoke(workbook, 'SaveAs', args);
    Client_OLE2.Destroy_Arglist(args);
    /* release workbook */
    Client_OLE2.Release_Obj(workbook);
    Client_OLE2.Release_Obj(workbooks);
    /* Release application */
    Client_OLE2.Invoke(application, 'Quit');
    Client_OLE2.Release_Obj(application);
    /* Display successfull message */
    message('File successfully saved as ' || l_filename);
    END;I can export to excel using the above code ONLY if I base a block on the table emp
    however my requirement doesn't really need me to show the emp block on my form, but the ability with a push-button to export the results to an excel spreadsheet.
    My question is. how can I alter the above code to use the cursor instead of a block to export the results to an excel spreadsheet?
    any help would be most appreciated.

    I am basing this on a block in the form as stated in my original post.This was the original post, so there you are using the cursor, not data in the block.
         CURSOR x_cur IS
              SELECT emp_id,Most of the time an export as csv file is enough, so you don't really need OLE2. If that is the case, you can use utl_file in a database procedure and a query that looks like this:
    select '"'||empno||","||
           '"'||ename||","||
           '"'||hiredate||","||
    from emp
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Export to Excel Question

    Forms [32 Bit] Version 10.1.2.3.0 (Production)
    How can I get the field names as column headings on export excel for the first row using my cursor below?
    PROCEDURE generate_summary IS
    l_filename varchar2(200);
    FLAG BOOLEAN;
    directory_name varchar2(200);
    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;
    args Client_OLE2.List_Type;
    cell ole2.Obj_Type;
    k INTEGER;
    j integer;
         CURSOR x_cur IS
              SELECT emp_id,
                           name,
                           dept
              FROM   emp;
    begin
    l_filename := webutil_file.file_save_dialog
    (directory_name => '<dir>:\'
    ,file_name => 'summary'||sysdate||'.xls'
    ,file_filter => null
    ,title => 'Select client side filename where App Server file will be saved');
    /* Calling Excel and adding a new worksheet to a blank workbook */
    application := Client_OLE2.create_obj('Excel.Application');
    CLIENT_OLE2.SET_PROPERTY(APPLICATION, 'VISIBLE', false);
    workbooks := Client_OLE2.Get_Obj_Property(application, 'Workbooks');
    workbook := Client_OLE2.Invoke_Obj(workbooks, 'Add');
    worksheets := Client_OLE2.Get_Obj_Property(workbook, 'Worksheets');
    worksheet := Client_OLE2.Invoke_Obj(worksheets, 'Add');
    j:=1;
    for x_rec in x_cur loop
      args:=Client_OLE2.create_arglist;
      Client_OLE2.add_arg(args, j);
      Client_OLE2.add_arg(args, 1);
      cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
      Client_OLE2.destroy_arglist(args);
      Client_OLE2.set_property(cell, 'Value', name_in(x_rec.emp_id));
      Client_OLE2.release_obj(cell);
      args:=Client_OLE2.create_arglist;
      Client_OLE2.add_arg(args, j);
      Client_OLE2.add_arg(args, 2);
      cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
      Client_OLE2.destroy_arglist(args);
      Client_OLE2.set_property(cell, 'Value', name_in(x_rec.name));
      Client_OLE2.release_obj(cell);
      args:=Client_OLE2.create_arglist;
      Client_OLE2.add_arg(args, j);
      Client_OLE2.add_arg(args, 3);
      cell:=Client_OLE2.get_obj_property(worksheet, 'Cells', args);
      Client_OLE2.destroy_arglist(args);
      Client_OLE2.set_property(cell, 'Value', name_in(x_rec.dept));
      Client_OLE2.release_obj(cell);
      j:=j+1;
    end loop;
    Client_OLE2.Release_Obj(worksheet);
    Client_OLE2.Release_Obj(worksheets);
    /* Save the Excel file created */
    args := Client_OLE2.Create_Arglist;
    Client_OLE2.Add_Arg(args,l_filename);
    Client_OLE2.Invoke(workbook, 'SaveAs', args);
    Client_OLE2.Destroy_Arglist(args);
    /* release workbook */
    Client_OLE2.Release_Obj(workbook);
    Client_OLE2.Release_Obj(workbooks);
    /* Release application */
    Client_OLE2.Invoke(application, 'Quit');
    Client_OLE2.Release_Obj(application);
    /* Display successfull message */
    message('File successfully saved as ' || l_filename);
    END;The output generated only contains the data, no column headings.
    Thanks!

    This is a piece of my total procedure. If row = 2, it means that you are getting the first row of data. In that case, write row 1 (the header row) first.
       -- Get the data
       first_record;
       -- Data starts at row 2. Row 1 is for the header.
       v_row  := 2;
       <<record_loop>>
       loop
          v_item := v_first_item;
          v_col  := 1;
          <<item_loop>>
          loop
             exit when v_item =i_block||'.'||null;  -- no more items in the block
             if not id_null(find_item(v_item))
             then
                if get_item_property(v_item,item_type) in ('TEXT ITEM','DISPLAY ITEM','CHECKBOX','RADIO GROUP','LIST')
                and get_item_property(v_item,visible) = 'TRUE'
                then
                   if v_row = 2
                   then
                      -- v_row=2: 1st data row, so put the column headers in row 1
                      -- Column header is: 1)item prompt 2)database column name
                      v_header := get_item_property(v_item,prompt_text);
                      if v_header is null
                      then
                         v_header := get_item_property(v_item,column_name);
                         if v_header is null
                         then
                            v_header := '?';
                         end if;
                      end if;
                      -- Put the column header in row 1
                      put_cell(1,v_col,v_header);
                   end if;

Maybe you are looking for

  • Is there a way to open a chat window with lookout?

    I know there is a windows-chat embeded in Windows but our IT department has it blocked in all the machines. So I created, using a run object, a wordpad window to chat remotelly with the operator of the system using VNC4.0. Problem is that as soon as

  • TS3274 iPad mini won't update to iOS 7.0.4

    I just bought an iPad Mini today and every time I try to update the OS to 7.0.4, it gives me an error message about halfway through that says "An error occured downloading iOS 7.0.4" How do I fix this?

  • Export to Excel with Filter values

    I have implemented Prakash Darji's Exporting tips. http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/47fe4fef-0d01-0010-6f87-ed8ecb479123 But it very important for us to only allow the user to only export the data which is available

  • What is the proces code for mbgmcr

    what is the proces code for mbgmcr

  • Is the iPhone 5 compatible with the Audi Music Interface (AMI) system in my car?

    I have a 2011 Audi A4 and I'm wondering if the iPhone 5 will work with car's audio system if I use the 30-pin to Lightning adapter. Will I be able to control my music with the steering wheel and have visibility to tracks, etc. on the dash display as