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
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
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 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 ?
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.
frxReportn.Dictionnary.Vaiables[NameOfVariable] := QuotedStr(QuotedStr(DelphiVariable)) ? I use IBO objects and all the queries are externals to the report.
I create with Delphi all the frdbdataset I need
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
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.
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
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
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
And I got a message from fr4 there is no dataset
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
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
- 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]