How to export report as text file in navision

How to create a report to export into text file and also i had three companies i want to run the report in one company then i need to get each company information in to in each text file. when i run from another company then i need to get error message.
Thanks in advance.

Answers

  • As I followed to but i am getting only one record but i need to see all the records in the customer table and vendor table .
    File1.CREATE(filePath);
    File1.CREATEOUTSTREAM(gOutStreamOst);
    gOutStreamOst.WRITETEXT(Customer."No."+';'+Customer.Name+';'+Customer.Address+';'+Customer."Phone No."+';'+Customer."E-Mail");
    gOutStreamOst.WRITETEXT();
    gOutStreamOst.WRITETEXT(Vendor."No."+';'+Vendor.Name+';'+Vendor.Address+';'+Vendor."Phone No."+';'+Vendor."E-Mail");
    File1.CLOSE;
  • HannesHolstHannesHolst Member Posts: 119
    Hi,

    Why don't you use a dataport?
    All companies are in the table "Company" (ID 2000000006).
    You can change the company of an individual table using the function "Rec.CHANGECOMPANY"
  • Thanks for the reply @ HannesHolst.
    as per my requirements i need to do it by using report.
    i had written the code on OnPostReport, but i am getting only one record in the customer table and also when i run in one company the other company customer information should create a new text file individually.
  • lubostlubost Member Posts: 623
    OnAfterGetRecord trigger is your target
  • Thanks for the reply @ lubost

    Yeah i tried this solution also but no result i am getting only one record if the customer i.e,. last record. i apply looping as
    gCountInt := 0;
    IF Customer.FIND('-') THEN
    REPEAT
    gCountInt := gCountInt + 1;
    UNTIL Customer.NEXT <= 0;
    but no result.
    i think something i am missing the code,,
Sign In or Register to comment.