migrating from FR2.5 to FR4.5.. need HELP

Hi,
I just buy an upgrade from FR2.5 to FR4.5

I have a project in Delphi 5 with reports and a embedded designer wich allow my users to make change in the reports

I have understood that I MUST update all my reports manually AND all the reports wich have been modified by my users, due to deep change in the script syntax.
OK lot a stuff but ...

As AlexTZ said in "FR2 -> FR4 conversion issue, I try to open old frf report with Fr4... I got "Invalid file format"
So ..
Using fr2.5, I open each report in design mode and save it in fr3 format.

When opening such a fr3 report with the builtin designer (frxReport) on Delphi I got an error : unable to find class TfrReport !
Well I add to my project frx2to30.pas
Fine, I can open the report but ....
I have lost all my data access and even for memos with static data (constant like column header) I got blank memo !

I have try fr2x-fr3 converter and the programme become busy and never finish the work !

Please help and tell me HOW to do
thanks a lot

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:53PM
    I am not sure how you are working., but don't use the old save to fr3 from fr2.5x
    in your fr4 project
    add the frx2to30.pas unit to your uses clause, this will allow fr4 designer to open an fr2.xx file and save it in fr3/4 format.
    make sure your fr4 project contains all the fr4 components that are equivalent to fr2 components that were used in your fr2 project. when finished remove the conversion unit.
    you may want to set the designer file open dir and file save dir props to suit your needs.

  • edited 8:53PM
    gordk wrote: »
    I am not sure how you are working., but don't use the old save to fr3 from fr2.5x
    in your fr4 project
    add the frx2to30.pas unit to your uses clause, this will allow fr4 designer to open an fr2.xx file and save it in fr3/4 format.
    make sure your fr4 project contains all the fr4 components that are equivalent to fr2 components that were used in your fr2 project. when finished remove the conversion unit.
    you may want to set the designer file open dir and file save dir props to suit your needs.
    I have added frx2to30.pas to my project and in Delphi double-click on an icon TfrxReport wich launch the Designer and then inside the designer
    I try open a report with 2.51 format and get the message : invalid file format

    In fact I can't compile my project for now, I got a lot of error from migration (I have used the migrate tool fr2x-fr3 converter).
    Errors for frHTMExport wich have not been converted, frxShapeObject wich have been converted but dont exists, LoadReport method for the Designer wich parameters have changed, UserFunction parameters list have changed too for frxReport

    May be it would be better to isolate the project migration from the reports migration, and create a stand alone programme to migrate the reports ?
  • gordkgordk St.Catherines On. Canada.
    edited 8:53PM
    in some cases it may be easier to do so.
    here are some tips
    delphi code to set values for categorized variables must change when passing string values
    you need extra Apostrophes.

    if your fr2x report contained memos with datafields like [table1."fieldname"] and was connected to
    an frdbdataset that pointed to table1 you must have an frxdbdataset pointing to table1 and its username must be set to table1

    inside the report code you can no longer create variables on the fly using code like [myvarname] := 10
    or set the value of a categorized variable, categorized variables require the use of the get or set method. ie set := 10;.
    you can also create typed variables just like in delphi, either at the start of a code page (global to report) or within in an event procedure(local to procedure), these variables can be set in code by just using their name ie: myvariable := 10

    in delphi, code for the events of the tfrxreport component must change from what it was in fr2x to suit fr3 / fr4 syntax
    ie:
    using the find object method to set a property of a report component after loading the report
    var
    mv : tfrxmemoview

    begin
    mv := tfrxreport1.findobject('Memo1');
    mv.propertyname := value.

    fr2x and fr4x can exist in the same project, so start with adding the required fr4 components
    and start by converting a simple report, note what needs to be changed to suit fr4x before continuing on with more complex reports.
  • edited 8:53PM
    gordk wrote: »
    in some cases it may be easier to do so.
    here are some tips
    delphi code to set values for categorized variables must change when passing string values
    you need extra Apostrophes.
    so I need that code
    frxReportn.Dictionnary.Vaiables[NameOfVariable] := QuotedStr(QuotedStr(DelphiVariable)) ?
    gordk wrote: »
    if your fr2x report contained memos with datafields like [table1."fieldname"] and was connected to
    an frdbdataset that pointed to table1 you must have an frxdbdataset pointing to table1 and its username must be set to table1
    I use IBO objects and all the queries are externals to the report.
    I create with Delphi all the frdbdataset I need
    gordk wrote: »
    inside the report code you can no longer create variables on the fly using code like [myvarname] := 10
    or set the value of a categorized variable, categorized variables require the use of the get or set method. ie set := 10;.
    you can also create typed variables just like in delphi, either at the start of a code page (global to report) or within in an event procedure(local to procedure), these variables can be set in code by just using their name ie: myvariable := 10

    in delphi, code for the events of the tfrxreport component must change from what it was in fr2x to suit fr3 / fr4 syntax
    ie:
    using the find object method to set a property of a report component after loading the report
    var
    mv : tfrxmemoview

    begin
    mv := tfrxreport1.findobject('Memo1');
    mv.propertyname := value.

    fr2x and fr4x can exist in the same project, so start with adding the required fr4 components
    and start by converting a simple report, note what needs to be changed to suit fr4x before continuing on with more complex reports.
    Well, I need to migrate apart the projects and the reports.
    with delphi, I manage frReport variables, userfunctions and all the datasets and for some kind of reports I create
    the whole report by program.
    In this last case, as I create FR component, I directly have a link to the FrObject and need not using FindObject, is that true ?

    For reports I have created, I can migrate these reports, but for those my users have created/modified how
    should I handle these reports ?

    thanks
  • gordkgordk St.Catherines On. Canada.
    edited 8:53PM
    so I need that code
    yes only when passing strings, and note the change to your sample.
    frxReportn.Variables := QuotedStr(QuotedStr(DelphiVariable)) ?

    i suggest before you try any more conversions try creating a report using fr4.
    read the programmers manual for how to work from delphi, ie sample above is covered in the chapter working with a list of variables.
    for inside the report and designing reports read the user manual, and try building some of the samples.

    once you have a good idea on how things work in ver 4 then do conversions.

    as far as converting customer designed reports you can always do them for the customer, (good revenue source), or leave the old fr2 components in place so the can run their custom reports.
    in my own applications i give them a choice to design in old or new version and call the correct designer depending upon their choice.
  • gordkgordk St.Catherines On. Canada.
    edited 8:53PM
    here are some more things to pay attention to as the converter does not change them
    once you have added all your frx components to the apps delphi form
    and named yor frxdbdatset/s appropriately, and coded event handlers ,
    before you try running the report, open in designer
    from the menu click report options >datasets and mark the datasets you want enabled.
    in the report select any databands masterdata, detaildata, set therir dataset property to the correct dataset.
    check the variables in the categorized variable list menu>reportoptions>variables select each variable and look at the value in the expression if it contains datafield names in [] change the [] to <>.

    check any memos in footer bands that contain aggregate expressions such as
    [Sum([pyrljnl."Ptax"])]
    the inner set of [] must be changed to <>
    ie
    [Sum(<pyrljnl."Ptax">)]
    or better yet full syntax
    [Sum(<pyrljnl."Ptax"]>,databandname,flag)]
    where databandname is the name of masterdata or detail data and flag is the integer value for the type of total 0,1,2 . 2 := running total,
    and of course read the conversion issues post pinned to this forum

  • edited 8:53PM
    gordk wrote: »
    so I need that code
    yes only when passing strings, and note the change to your sample.
    frxReportn.Variables := QuotedStr(QuotedStr(DelphiVariable)) ?
    Well I have tried and as in FR2.5 I use frReportn.Variables := QuotedStr(DelphiVariable)
    It seems to work in FR4, so for me there is no change of how to write to a variable
    But the main differnce is that in FR4, I have extra quotes when reading variable. I must use AnsiExtractQuotedStr to retrieve the right value
    gordk wrote: »
    i suggest before you try any more conversions try creating a report using fr4.
    I have tried and don't succeed.
    I want to use externals frxDBDataset (I manage all the queries by code, for record's access rights) so I
    enabledDataSet.Add(nil) // I use my own datasets and don't want any other dataset to be visible
    loadfromfile
    frxReport.Datasets.Add(myDataset)
    PrepareReport // It seems that fr4 is slower than fr25 and I want a window to appears showing the progression
    ShowPreparedReport // instead of ShowReport witch displays no progression and the user is wondering what happens

    And I got a message from fr4 there is no dataset
    gordk wrote: »
    read the programmers manual for how to work from delphi, ie sample above is covered in the chapter working with a list of variables.
    for inside the report and designing reports read the user manual, and try building some of the samples.
    I have done all, but can't find sample witch use frxDBDataSet. In these samples, there no code in Delphi, all is done in the report. It's not my way, for me a same report is used with vhundreds of differents queries: by code I add links and fields to use the report with the environnement the user creates

    furthermore, in the manuals, I haven't see any descripton of the frxComponent's properties, methods or events. Where could I find it
    gordk wrote: »
    once you have a good idea on how things work in ver 4 then do conversions.

    as far as converting customer designed reports you can always do them for the customer, (good revenue source),
    I have had a mail from AlexTZ for sending him my fr25 reports I can't convert with frx2to3 converter. I have sent him but I have no idea if he succeeds.

    Without help I can't go furher
  • edited 8:53PM
    Henry49fr wrote: »
    enabledDataSet.Add(nil) // I use my own datasets and don't want any other dataset to be visible
    loadfromfile
    frxReport.Datasets.Add(myDataset)
    PrepareReport // It seems that fr4 is slower than fr25 and I want a window to appears showing the progression
    ShowPreparedReport // instead of ShowReport witch displays no progression and the user is wondering what happens

    And I got a message from fr4 there is no dataset
    Some informations about the issue:
    - I have removed enabledDataSet.Add(nil) and now my code looks like
    LoadFromFile..
    create and prepare Dataset, Datasource, open Query
    create TfrxDBDataset
    Set TfrxDBDataset.Username (in fr25 I used Name instead of UserName)
    Set TfrxDBDataset.DataSource
    frxReport.DataSets.add(TfrxDBDataset I have created)
    frxReport.EnabledDataSets.add(TfrxDBDataset I have created)
    if DebugMode then frxReport.DesignReport
    frxReport.PrepareReport
    frxReport.ShowPreparedReport

    In debugMode when the Designer open
    on the Data tab of the DataTree window I can see my dataset and all the fields
    thenI hit Ctrl-P (preview) and I have only a blank report with only the Title
    I close the designer
    and ...
    I see the report fine ! [img]style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid=":rolleyes:" border="0" alt="rolleyes.gif" /> In debugMode if I don't preview the report, I see a blank report after closing it When not in DebugMode I always see a blank report What kind of initialisation is done by preview witch I miss in my code ? regards[/img]

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.