How to get file path properties in a form

sabzamsabzam Member Posts: 1,149
Hi Everyone,

Is there a way how to achieve the same results as a dataport but through a form? What I mean is having the option to search in the harddisk for the file to import/export?

Thanks

Answers

  • garakgarak Member Posts: 3,263
    take a look into CU 412 "Common Dialog Management" function OpenFile().

    Regards
    Do you make it right, it works too!
  • sabzamsabzam Member Posts: 1,149
    HI,

    Thanks for your immediate reply. By any chance do you know of a form or a dataport from which I can have a look at how this coduenit has been used?

    Regards
  • garakgarak Member Posts: 3,263
    for example form Create Interaction (5077) or form Implementation (8600)

    Regards
    Do you make it right, it works too!
  • ErictPErictP Member Posts: 164
    Look at the Request form of report 81

    In the OnAssistEdit trigger of the textbox filename:
    FileName := CommonDialogMgt.OpenFile(Text006,'',2,'',0);
    
  • sabzamsabzam Member Posts: 1,149
    10x alot.............. seems that it works
  • sabzamsabzam Member Posts: 1,149
    Hi,

    The following worked properly

    FileName := CommonDialogMgt.OpenFile(Text006,'',2,'',0);

    But now it is giving me the following error "The operating system cannot find the drive and directory specified for the file". What I need is to import a csv file and fill in a table which before was being carried out by a dataport.

    Do you think you can help me on this?

    Regards
  • SavatageSavatage Member Posts: 7,142
    is there a reason you don't want to use a dataport that already works?
  • sabzamsabzam Member Posts: 1,149
    Problem solved by:

    Editing CDU 412:

    Created text constant with extension .csv and coding added an option to the default file types

    Form

    Using the above given code & adding the CurrDataport.Filename := ImportFileName;

    where ImportFileName is a user created variable to store the file name

    Regards & Thanks to all for the help
  • AdministratorAdministrator Member, Moderator, Administrator Posts: 2,499
    [The use of [SOLVED] in the Topic Title is no longer supported. Please edit the first message in the thread and use the field Attribute (below the Subject-field) to put a green checkmark next to the Topic Title]
Sign In or Register to comment.