Exporting report to XML issue.

TiwazTiwaz Member Posts: 98
edited 2016-11-17 in NAV Three Tier
Hello Experts.
I am trying to export existing report to XML so I can perform some further formating on that XML.
I used this synthax:
REPORT.SAVEASXML(38023564,'C:\Proba.xml');
but it returns error (in attachment)... I tried many different locations + I have full control over named file under Permissions for SYSTEM.
What can be cause of this and is there an alternative way to save report to XML?
THANKS IN ADVANCE

Answers

  • KishormKishorm Member Posts: 921
    You won't be able to save on the root of drive C:

    Also remember that it will be saving on the server running the NST and it is the account running the NST service that needs access to the path (from the server). I.e. C:\Temp with be the one on the server not the one on your machine.
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    It will be saved on the computer that is running Microsoft Dynamics NAV Server.
    Please check whether you have permissions in that server.
  • TiwazTiwaz Member Posts: 98
    Thank you for your answer. Not sure I comprehend.
    I tried to set a path to Flash drive but it reports "Device not ready".
    Could you explain in a bit mored detail what should I do to succesfully save this file? :)
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    you need to have permission to the path in NST Server and Use Download function to copy the file from NST server to local machine..
  • TiwazTiwaz Member Posts: 98
    Hello. Our System Administrator just checked and I have all permissions set.
    I also tried a code from article above but now error reads that I have no permissions or that path is Read-only which is not the case!
  • TiwazTiwaz Member Posts: 98
    Ok, I managed to make it work. Code from https://msdn.microsoft.com/en-us/library/dn789624(v=nav.90).aspx worked when I only placed file name in Name := without path :)
    Now, just a quick question:
    Is it possible to transform XML we get from report using XSD file? Because it gives me error

    Incorrect definition for the root element in schema.

    When I use this xsd


    <?xml version="1.0" encoding="UTF-8" ?>

    <xs:schema elementFormDefault="qualified" targetNamespace="http://pid.purs.gov.rs&quot; version="1.4.3"
    xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; xmlns:tns="http://pid.purs.gov.rs"&gt;
    <xs:element name="PodaciPoreskeDeklaracije" type="tns:PodaciPoreskeDeklaracijeTip"/>

    <xs:simpleType name="DecimalPozitivNulaTip">
    <xs:restriction base="xs:decimal">
    <xs:minInclusive value="0"/>
    <xs:fractionDigits value="2"/>
    <xs:maxInclusive value="9999999999999999.99"/>
    </xs:restriction>
    </xs:simpleType>
    .
    .
    .
    .


    </xs:schema>


    on this xml I got from report:


    <?xml version="1.0" standalone="yes"?>
    <ReportDataSet name="IOSI" id="38023564">
    <DataItems>
    <DataItem name="Company_Information">
    <Columns>
    <Column name="Year">2016</Column>
    <Column name="Month">Novembar</Column>
    <Column name="CompanyName">IN2 Dynamics</Column>
    <Column name="City">Beograd</Column>
    <Column name="Adresa">Vladimira Popovića 6</Column>
    <Column name="PIB">200010503</Column>
    <Column name="CompanyID">26304040</Column>
    <Column name="InustryCode"></Column>
    <Column name="TotalEmplWithDisabilities">0</Column>
    .
    .
    .
    .
    .
    .

    <Column name="gcDiffAmt7"></Column>
    <Column name="gcDiffAmt8"></Column>
    <Column name="gcDiffAmt9"></Column>
    <Column name="gcDiffAmt10"></Column>
    </Columns>
    </DataItem>
    </DataItems>
    </ReportDataSet>
Sign In or Register to comment.