FR2 -> FR4 conversion issues

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

  • edited 1:28PM
    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?
  • edited 1:28PM
    rulonv wrote: »
    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?

    quando tento editar o relatorio, da invalid file format.
  • gpigpi
    edited 1:28PM
    rulonv
    use
    frxReport1.LoadFromFile('1frf');
    frxReport1.SaveToFile('1.fr3');
    
  • edited 1:28PM
    Issue of December 13, pp. 48976???48983, 2002 ... region, is required for the conversion of protofibrils to fibrils. MATERIALS AND METHODS .... distributions of aggregates in fr 2 and fr 4, we measured the ...
  • dschuchdschuch Dresden,Germany
    edited 1:28PM
    There where some sourcecode issues too (exspecially with <> and [])
  • edited February 2010
    hi. i've never done anything with fr before and now i have to convert a program from fr2.3 (i think it was freereport) to fr4.9. i'm missing some components, maybe you can help me out there:

    TfrSpeedButton -> found TSpeedButton?
  • edited 1:28PM
    I'm converting an old project (2.xx). Exporting to .FR3 and directly importing to FR4 is completely buggy.

    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,
  • edited 1:28PM
    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.

    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
  • edited 1:28PM
    I still have a problem with converting FR2 to FR4, is there anyone to help me
  • gpigpi
    edited 1:28PM
    ivan8888
    Can you upload your frf file to rapidshare.com?
  • edited August 2010
    thank you,,..
    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?



  • gpigpi
    edited 1:28PM
    wrote:
    or by using some other utility?
    Yes. Use FR Trial for converting
  • edited 1:28PM
    I can't convert FR2 to FR4.
    Is there's any other alternative?

    thanks

  • edited 1:28PM
    reenfoo wrote: »
    I can't convert FR2 to FR4.
    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!
  • gpigpi
    edited 1:28PM
    wrote:
    I can't convert FR2 to FR4.
    Is there's any other alternative?
    Did you try to use fr2xto30.pas for converting?
  • edited 1:28PM
    thank you,,..
    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?
  • gpigpi
    edited 1:28PM
    You may use FR Trial version for report's converting
  • edited 1:28PM
    thefreecat wrote: »
    I'm converting an old project (2.xx). Exporting to .FR3 and directly importing to FR4 is completely buggy.

    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???m still learning from you, as I???m improving myself. I absolutely liked reading all that is written on your blog.Keep the tips coming. I loved it!
  • edited 1:28PM
    Can I get some specific steps on how to do the conversion from FR2.x to FR4 in Builder C++ XE2?
    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
  • edited 1:28PM
    ok,i see

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.