Exporting data using Dataports

vbragancavbraganca Member Posts: 4
edited 2003-08-06 in Navision Attain
Hi,
How can i export data of 2 tables that must be linked by some fields (ex.: Production Order and Production Order Line) to a .txt file using only one dataport.

Thanks

Comments

  • MaciMaci Member Posts: 65
    Just create a dataport with 2 DataItems. Indent the second one, and in the properties make a DataItemTableView from the first.

    Look at the Application designers guide for more information.
  • vbragancavbraganca Member Posts: 4
    I've already did this but when i indent the second Data Item and try to compile, i receive a error message saying that the file format is not in UPXML.
    And i want to export to .txt format
  • MaciMaci Member Posts: 65
    Look at the Dataport Properties. Probably you have the FileFormat in UPXML (only in User Portal), and you need Variable or Fixed, depending on the txt you want.

    Good luck
  • vbragancavbraganca Member Posts: 4
    Hi

    What i mean is that the error message appear only when the File Format in not UPXML. And because i want to export with a File Format = Variable, i get this message.

    Thanks
  • tushaar99tushaar99 Member Posts: 35
    Hi

    One cannot indent a dataitem in a dataport. One can have multiple dataitems but not idented for import/export.

    That is specially kept for usage in User Portal.

    Regards
    Regards,
    Tushaar
  • RoelofRoelof Member Posts: 377
    The best way to do this is to create a report and define a file as export file.

    Roelof.
    Roelof de Jonghttp://www.wye.com
  • EvertEvert Member Posts: 1
    It's possible.

    Make a global variable for the production No and one for the production status (these fields are the primary key)
    Now fill these fields in the OnAfterExportRecord from the production order DataItem like this:
    VariableStatus := Status;
    VariableProdOrderNo := "No.";

    Go to the production order line dataitem and admit the following code in the OnPreDataItem trigger:

    SETRANGE(Status,VariableStatus);
    SETRANGE("Prod. Order No.",VariableProdOrderNo);
    FIND('-');

    And that's it !

    Good Luck !
  • RoelofRoelof Member Posts: 377
    Evert,

    That doesn't work. At least if I get you right.
    The problem is that you can't indent on a dataport. It means that first all records of DataItem 1 (Header) are being exported. After that, DataItem 2., the lines, will be exported. Problem here is, how do you know which lines?. An alternative would be to create a temp file during the export of the Header records, to capture the key fields for the Lines (or an array if not too many records involved).

    Roelof.
    Roelof de Jonghttp://www.wye.com
Sign In or Register to comment.