Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Export

Posted on by 4,818

Hi experts, I tried to create the export from xml port. It works, but how to export the data as the excel format as the default. I tried to change the format like this: Format: fixed text or Variable Text in the property, but has an error: 

An element with source type table cannot have tale elements children.

Please advise! Thank you!

*This post is locked for comments

  • Suggested answer
    4BzSoftware Profile Picture
    4BzSoftware 6,071 on at
    RE: Export

    Hi Snoppy,

    Is it something like this:

    1. Define XML port with <Xml> format:

    5618.2.png

    2. Open XML file with Excel:

    5618.2.png

    3. Object in Text format:

    OBJECT XMLport 5000 Test
    {
      OBJECT-PROPERTIES
      {
        Date=02/24/17;
        Time=[ 4:15:39 PM];
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      ELEMENTS
      {
        { [{3E4B8C1B-3003-4447-AD73-B852E9E8B013}];  ;Root                ;Element ;Text     }
    
        { [{153DDB48-A443-4392-B25C-10C22F6753F7}];1 ;SH                  ;Element ;Table   ;
                                                      SourceTable=Table36 }
    
        { [{C5B24BD1-95CB-4BD7-9AD2-F772BA07D830}];2 ;SH_DocNo            ;Element ;Field   ;
                                                      DataType=Code;
                                                      SourceField=Sales Header::No. }
    
        { [{9FE956CD-22AE-4BE1-BDB1-3A012DD51088}];2 ;SL                  ;Element ;Table   ;
                                                      SourceTable=Table37;
                                                      LinkFields=Field1=FIELD(Field1),
                                                                 Field3=FIELD(Field3);
                                                      LinkTable=Sales Header }
    
        { [{A0D13F29-1E9E-44AF-9F66-CA07FAE7D0C0}];3 ;SL_LineNo           ;Element ;Field   ;
                                                      DataType=Integer;
                                                      SourceField=Sales Line::Line No. }
    
        { [{5F8EF7EC-4194-4A88-86DB-7C771314DBB4}];1 ;SIH                 ;Element ;Table   ;
                                                      SourceTable=Table112 }
    
        { [{2449A811-9D15-4FBD-AAD3-AC69A6047E52}];2 ;SIH_DocNo           ;Element ;Field   ;
                                                      DataType=Code;
                                                      SourceField=Sales Invoice Header::No. }
    
        { [{5F3C371A-4ABD-4A4A-80B2-455579D8C2E4}];2 ;SIL                 ;Element ;Table   ;
                                                      SourceTable=Table113;
                                                      LinkFields=Field3=FIELD(Field3);
                                                      LinkTable=Sales Invoice Header }
    
        { [{07B68E0A-760B-4C12-A835-DE2AA7349EA3}];3 ;SIL_LineNo          ;Element ;Field   ;
                                                      DataType=Integer;
                                                      SourceField=Sales Invoice Line::Line No. }
    
      }
      EVENTS
      {
      }
      REQUESTPAGE
      {
        PROPERTIES
        {
        }
        CONTROLS
        {
        }
      }
      CODE
      {
    
        BEGIN
        END.
      }
    }
    


  • Suggested answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Export

    Snoppy,

    Dont know whether it really helps you or not but please have a look on standard XMLPorts like "IC Dimension Import/Export" (ID - 11) or "Import / Export Workflow" (ID - 1501).

     

    -Yogesh Kulkarni
    Please verify, if you find answer helpful.

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Export

    As Suresh suggested you need to use integer table ,define variables  and write a program to export the records

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Export

    I don't think NAV will allow to export in Fixed or Variable format with Parent/Child Link you need to redesign your xmlport, using an integer or variables or temporary table.

  • snoppy Profile Picture
    snoppy 4,818 on at
    RE: Export

    Thank you!

    5050 is not multiple tables
    1. The two tables are not linked tables and they are one
    2. There are no linked fields
    3. The second table is not indented

    If they are multiple tables, when the rest of the tables are indented, linked to the  previous tables and set up the format as the Variable Text, there will be errors.

    Thank you!

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Export

    For exporting from multiple tables I would suggest have a look at standard XMLPORT 5050 .

  • snoppy Profile Picture
    snoppy 4,818 on at
    RE: Export

    Hi experts,  one table in the XMPport is fine. It will export in text format. But I do not have luck with the two tables, and still has the error. I attached the screenshot. Please advise! Thank you!

    Stas.jpg

  • Suggested answer
    TharangaC Profile Picture
    TharangaC 23,116 on at
    RE: Export

    Can you please post the screenshot of the XML port structure. It will help us to find the issue.

  • Suggested answer
    Maneesha Profile Picture
    Maneesha 5,889 on at
    RE: Export

    On your error message feel like you have done some encapsulations check your coding fort that

    If you go by another way try Amol's comment

    or you can directly write to the DB

  • Suggested answer
    Amol Salvi Profile Picture
    Amol Salvi 18,694 on at
    RE: Export

    You can export data in csv or txt format and then you can open these file in excel

    You need to specify delimiters on xmlport like comma or TAB

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans