Report on to a text file

PremPrem Member Posts: 34
edited 2002-10-29 in Navision Financials
Hi All

I am trying to write a report on to a text file but unfortunately i am getting only the last line and only one line in that file how can i have multiple lines on the text file

Regard's

Prem

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Can you post some C/AL code?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • PremPrem Member Posts: 34
    This code is on onpresection


    fi.OPEN('C:\hex.txt');
    line:='1INHSBC'+COPYSTR(accno,1,3)+COPYSTR(accno,4,6)+COPYSTR(accno,10,3)+fullname;
    fi.WRITE(line);
    line:='';
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This code
    fi.OPEN('C:\hex.txt');
    should be in the OnPreSection of the Header.

    This code
    line:='1INHSBC'+COPYSTR(accno,1,3)+COPYSTR(accno,4,6)+COPYSTR(accno,10,3)+fullname;
    fi.WRITE(line);
    line:='';
    should be in the OnPreSection of the Body.

    If there is no printing involved in this report, you better put your code in the OnPreDataItem and OnAfterGetRecord triggers of the Dataitems. Then you should use the report property ProcessingOnly = yes.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • PremPrem Member Posts: 34
    Still its not wotking Luc !!!!
  • PremPrem Member Posts: 34
    Is there a way to add a new line character :roll:
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Be sure to add fi.TEXTMODE(TRUE) before your fi.OPEN statement.

    This is from the on-line help:
    If f.TEXTMODE is set to TRUE and Value is an integer, the system formats the integer into text and writes the result, followed by a new line character.

    If Value is a record, the system separates each field with a tab character.

    If f.TEXTMODE is FALSE and Value is an integer, the system writes the integer as an integer which is four bytes long.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • PremPrem Member Posts: 34
    Thanks Luc Seems to be Working ........ :lol:
    Let me do some R&D on this
  • PremPrem Member Posts: 34
    Instead of writing all the wariables into a string variable and transering into the text file , Cant we write the fields directly... when i try that its again the same.

    :cry:
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    Have a look at Dataports. They are used for exporting data to a text-file, or importing data.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • PremPrem Member Posts: 34
    No i am not straight away writing those fields ... basically i am writing infos on to a text file and that has to be in a format ,i have to convert each and every values in filed's.
Sign In or Register to comment.