Converting old FR2.x .frf files to FR4
--------------------------------------
Preserred way to do this is to include frx2xto30.pas unit into your FR4
application's uses list. You can open .frf files in the FR4 designer.
After you open a file, save it in the .fr3 format. After you convert all
files, REMOVE fr2xto30.pas from uses list.
The biggest compatibility problem is a script. In was totally redesigned in
FR3 and FR4 to bring new features such as variable types, classes, functions,
common language constructions, significant performance improvement.
Unfortunately this means you need to check all your existing script code.
SCRIPT
------
- in FR4 you must declare variables (pascal style), in FR2 it's not
supported (basic style).
FR2 code     FR4 code
a := 1; Â Â Â Â Â var a: Integer;
        a := 1;
- in FR4 you must use <> to surrond report variables, datafields and system
variables. In FR2 you must use [] for same purpose and can skip it if variable
has a "correct pascal identifier" name.
FR2 code           FR4 code
a := [dataset."Field"]; Â Â Â a := <dataset."Field">;
b := MyReportVariable; Â Â Â b := <MyReportVariable>;
- in FR2 you may use [] even if you don't have to do this. In FR4 using of
equivalent <> is restricted to datafields, report variables and system
variables only.
FR2 code           FR4 code
a := [Copy('a', 1, 1)]; Â Â Â a := Copy('a', 1, 1);
- in FR4 you can use pascal-style arrays. FR2 uses tricky arrays without
predefined bounds. Use TfrxArray in FR4:
FR2 code           FR4 code
ar[0] := 1; Â Â Â Â Â Â Â Â Â var ar: TfrxArray;
ar[10] := 2; Â Â Â Â Â Â Â Â ar := TfrxArray.Create;
ar['test'] := 3; Â Â Â Â Â Â ar[0] := 1;
ar[i] := 5; Â Â Â Â Â Â Â Â Â ar[10] := 2;
              ar['test'] := 3;
              ar[i] := 5;
- FinalPass, FreeSpace, CurY and other engine variables must be changed to
Engine.FinalPass, Engine.FreeSpace, Engine.CurY. Partially solved by the
converter (it adds "with Engine do" to each code block).
REPORT LAYOUT:
--------------
- Text, RichText objects: in FR2 you can use [] to define an
expression in the text and inside this expression. In FR4 you must use []
to define an expression and <> inside this expression:
FR2 TfrMemoView text: Â Â Â Â Â Â Â Â FR4 TfrxMemoView text:
Total: [Sum([table1."Field1"])] Â Â Â Total: [Sum(<table1."Field1">)]
- also check your texts for inconsistent [] use:
FR2 TfrMemoView text: Â Â Â Â Â Â Â Â FR4 TfrxMemoView text:
[[Copy(s, 1, 1)]] Â Â Â Â Â Â Â Â Â Â [Copy(s, 1, 1)]
[Copy([s], 1, 1)] Â Â Â Â Â Â Â Â Â Â either [Copy(s, 1, 1)] or [Copy([s], 1, 1)] if "s" is reportvariable
- GroupHeader: check Condition property:
FR2 group condition: Â Â Â Â Â Â Â Â FR4 group condition:
Copy(MyReportVariable, 1, 1) Â Â Â Â Copy(<MyReportVariable>, 1, 1)
[Copy([MyReportVariable], 1, 1)] Â Â Copy(<MyReportVariable>, 1, 1)
- redesign cross-tab layout due to significant changes in FR4
DELPHI CODE:
------------
- change "Tfr" prefix to "Tfrx"
- change unit names prefix "FR_" to "frx"
- change all event handlers because they take new types of parameters
- in FR2 you can pass static variables via frVariables global
object. In FR4 use frxGlobalVariables to do this.
FR2 code               FR4 code
frVariables['myname'] := 'name'; Â Â frxGlobalVariables['myname'] := 'name';
Comments
If so, is there another way to do the conversions using the Basic edition ... or by using some other utility?
quando tento editar o relatorio, da invalid file format.
use
TfrSpeedButton -> found TSpeedButton?
But if you have the chance to still have a FR3 installation somewhere, you can :
- export from 2.xx to FR3 (in FR2)
- open the export.fr3 in FR3
- save it to a new name (like export2.fr3)
- open it in FR4
Many things still don't work, you have to put the fields back to their respective bands, but you don't have to redesign everything.
HTH,
application's uses list. You can open .frf files in the FR4 designer.
After you open a file, save it in the .fr3 format.
I did this, but when I try to open the file in FR4 it says:
The followinf error(s) have occured:
Cannot fing class TfrReportPage
Can you upload your frf file to rapidshare.com?
It appears that you must use the 'Run-time designer' included in the Standard version and above to make these conversions. Is this correct?
If so, is there another way to do the conversions using the Basic edition ... or by using some other utility?
Is there's any other alternative?
thanks
I did not make any conversion. I have FR2 and FR4 both installed and i just keep the old reports and all the new are made with the v4. After V4 installation, go to Delphi > components > install packages and you will see FastScript duplicated. Delete the old FastScript. Then go to Tools > Options > Library and move the 'C:\Program Files\FastReports\FastReport 4\LibD11' above the first library path you found about the FR2. And its done!
It appears that you must use the 'Run-time designer' included in ugg boots shortthe Standard version and above to make these conversions. Is this correct?If so, is there another way to do the conversions using the Basic edition ... ugg boots tallor by using some other utility?
You can also open the .FR3 file in a text editor and replace all
Memo.text=
with
text=
This will fix the empty memo texts.
I tried adding FRx2toFR30.pas to the project, but it doesn't compile--it asks for System.pas, which
I don't have.
I have a feeling I'm not doing this right.
Is anyone else doing this with Builder C++ XE2 or a recent C++ version?
Much thanks!
john j