The previous solution is an easy and quick way to solve many issues.
Anyway, here I leave a proffesional solution developed with a codeunit that reads the report object (in txt mode) and look for what it needs and then creates a new file with the report modified ready to be imported back in Navision.
This works for any situation.
Here is the code:
File@1100000 : File;
OldVieja@1100001 : Text[500];
NewFile@1100002 : File;
NewString@1100003 : Text[550];
OldStringInit@1100004 : Text[500];
OldStringEnd@1100005 : Text[500];
CR@1100006 : Char;
LF@1100007 : Char;
Lee@1100008 : Boolean;
NewFontSize@1100009 : Integer;
NewFontSize := 9;
file.WRITEMODE(FALSE);
file.TEXTMODE(TRUE);
NewFile.WRITEMODE(TRUE);
NewFile.TEXTMODE(TRUE);
NewFile.CREATE(‘C:\placeYourPathHere\report.txt’); //custom this line
CR := 13;
LF := 10;
file.OPEN(‘C:\path\fileToImport.txt’);
REPEAT
file.READ(OldString);
IF STRPOS(OldString,‘SECTIONS’) <> 0 THEN Lee := TRUE;
IF STRPOS(OldString,‘REQUESTFORM’) <> 0 THEN Lee := FALSE;
IF Lee THEN
IF (STRPOS(OldString,’;TextBox ‘) <> 0) OR
(STRPOS(OldString,’;Label ‘) <> 0) THEN BEGIN
OldStringInit := COPYSTR(OldString,1,57);
OldStringInit += ‘FontSize=’+ FORMAT(NewFontSize)+’;’+ FORMAT(LF)+FORMAT(CR);
OldStringEnd := PADSTR(’’,56,’ ')+COPYSTR(OldString,58);
NewString := OldStringInit + OldStringEnd;
NewFile.WRITE(NewString);
END
ELSE
NewFile.WRITE(OldString)
ELSE
NewFile.WRITE(OldString);
UNTIL file.POS = file.LEN;
file.CLOSE;
NewFile.CLOSE;