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
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)
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)
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.
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.
Comments
fi.OPEN('C:\hex.txt');
line:='1INHSBC'+COPYSTR(accno,1,3)+COPYSTR(accno,4,6)+COPYSTR(accno,10,3)+fullname;
fi.WRITE(line);
line:='';
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.
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.
Let me do some R&D on this