FastReport 2.5* can't open the frf files created in the previous version.
Question: FastReport 2.5* can't open the frf files created in the previous version.
Answer:
(FreeReport 2.2 .frf files can't be opened with FR2.4)
Change the first byte in the report file to 16h and do the following modifications in source code. After these modifications, load the report and save it. Finally, return back the original code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
FR_Class: function ReadString(Stream: TStream): String; begin { if frVersion >= 23 then} Result := frReadString(Stream) {else Result := frReadString22(Stream);} end; procedure ReadMemo(Stream: TStream; Memo: TStrings); begin { if frVersion >= 23 then} frReadMemo(Stream, Memo){ else frReadMemo22(Stream, Memo);} end; FR_Utils: procedure frReadMemo(Stream: TStream; l: TStrings); var s: String; b: Byte; n: Word; begin l.Clear; l.Text := frReadString(Stream); exit; Stream.Read(n, 2); if n > 0 then repeat Stream.Read(n, 2); SetLength(s, n); Stream.Read(s[1], n); l.Add(s); Stream.Read(b, 1); until b = 0 else Stream.Read(b, 1); end; function frReadString(Stream: TStream): String; var s: String; n: Integer; b: Byte; begin Stream.Read(n, 4); SetLength(s, n); Stream.Read(s[1], n); // Stream.Read(b, 1); Result := s; end; |