File Dialog in Dataports

Paul_BradburyPaul_Bradbury Member Posts: 15
edited 2000-03-10 in Navision Financials
I am using the userrequestform in a dataport and am using a field to enter the filename. Can anyone tell me how to code the file dialog (ie. used to browse the disk for files) which is displayed automatically when the userrequestform is not used.

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This is the trick:

    1. Create a global variable eg. Filenametext with length 250
    2. Place a textbox on the requestform with source-expression your variable eg. Filenametext
    3. Renumber the ID of the control to 1
    4. Place a label on the requestform with caption 'Filename'
    5. Insert this line on the PreDataport trigger:
    <code>CurrDataport.FILENAME := Filenametext // (Filenametext is the source expression of TextBox ID 1)</code>
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • Weston_Binford_IIIWeston_Binford_III Member Posts: 7
    Does anybody know how to do the same thing for a report? Is it possible to get access to the File Dialog box other than through the above trick?

    For example, if I want to export a report as a delimited file, how do I give the user the ability to easily choose where to put that file?

    -Weston

    Weston M. Binford III
    Trusted Business Information Systems, Inc.
    <URL=http://www.trustedbis.com>www.trustedbis.com</URL&gt;
    <EMAIL>[email protected]</EMAIL>


    [This message has been edited by Weston Binford III (edited 25-02-2000).]
    <b>Weston M. Binford III</b>
    Trusted Business Information Systems, Inc.
    <email>[email protected]</email>
  • DennisDennis Member Posts: 25
    To do this you must create the following variable:

    FileDialog OCX Microsoft Common Dialog Control, version 6.0

    Then you can use code like this:

    FileDialog.DialogTitle('Select document');
    FileDialog.Filter('Worddocuments *.doc)|*.doc|All files (*.*)|*.*');
    FileDialog.ShowOpen;
    IF FileDialog.FileName <> '' THEN
    newFileName := FileDialog.FileName;

    Succes

    Dennis van Es
    PerCom: Research & Development BV
    The Netherlands
    Dennis van Es
    Qwinsoft BV
    The Netherlands
  • SimonWSimonW Member Posts: 77
    Sorry - didn't mean to post this entry

    [This message has been edited by SimonW (edited 25-02-2000).]
  • StefanStefan Member Posts: 5
    The method with the MS Common Dialog Control requires a Design Time License Version?!

    Any suggestions?
  • DennisDennis Member Posts: 25
    You only need on ocx-enabled licence for compiling the object. Once the object is compiled you (reed your client) don't need it anymore.

    Dennis

    [This message has been edited by Dennis (edited 01-03-2000).]
    Dennis van Es
    Qwinsoft BV
    The Netherlands
  • Craig_NeedhamCraig_Needham Member Posts: 23
    Thank you Dennis for that tip. I was wondering about it as well :-)

    regards

    Craig Needham
  • Willy_ExterkateWilly_Exterkate Member Posts: 3
    The OCX you mentioned works fine if you want to select a file, but not if you only want to select a directory.
    Is there a solution?
  • Craig_NeedhamCraig_Needham Member Posts: 23
    With regards to Stefan's note.

    I too have the design time license problem. My Navision license allows OCX, so I asume its a microsoft license for using that OCX. I know OCX Controls can have embedded license security. I don't know much about this subject, can anyone clear this up for Stefan and myself?

    Regards Craig.
  • LudoLudo Member Posts: 14
    To clear up. It 's like Dennis said in a previous note :

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Dennis:
    You only need on ocx-enabled licence for compiling the object. Once the object is compiled you (reed your client) don't need it anymore.<HR></BLOCKQUOTE> But some OCX's require an additional design time license.

    In standard NF you have the same problem with CU 397 Mail which is using Microsofts MAPI ocxes. In other to test :
    - export the codeunit as a fob (backup)
    - recompile it : if does not succeed, you will get the same message. In this case installing Visual Basic (e.g. VB 5.0) will solve your problem. The design time license for the MAPI ocx is included there ...

    Clear enough ?

    Ludo
  • regarega Member Posts: 7
    another way without OCX is
    to use Import.
    The problem is that you cannot put an variable of a BLOB
    but you can use a variable of a Record with Temporary

    e.g(one table with an BLOB field)

    VAR TempItem Record Item TEMPORARY = TRUE

    Filename := TempItem.IMPORT(TempItem.Picture,TRUE) =
    open an Dialog -> the import is temporary !!!!

    nice greetings



    Gayer Rene
    Projektmanagment
    NAVIConsult
    Rene Gayer (MVP)
    dynamicsblog.mbstn.com
Sign In or Register to comment.