Conversion from 2.5 to 4.0
Hi all,
I'm trying to convert my FastReport 2.5 code into the latest FastReport 4.
I have some problems because I don't know I can change some events present into the FastReport 2.5, in particular the events associated to the TfrxReport component.
The events are the foolowing:
BeginBand,
EndBand,
BeginPage,
EndPage.
Someone can Help me please?
I hope that I was clear.
Thanks in advice,
Marco.
I'm trying to convert my FastReport 2.5 code into the latest FastReport 4.
I have some problems because I don't know I can change some events present into the FastReport 2.5, in particular the events associated to the TfrxReport component.
The events are the foolowing:
BeginBand,
EndBand,
BeginPage,
EndPage.
Someone can Help me please?
I hope that I was clear.
Thanks in advice,
Marco.
Comments
for begin and end band and not inside the report.
use the onbeforeprint event it fires for every object in the report
onafterprint is the same
procedure TForm1.frxReport1BeforePrint(Sender: TfrxReportComponent);
begin
if sernder.name = 'Masterdata1' then
begin
do something (read or set a variable)
end;
end;
onbeforeprint for a page only fires once when the design page is started
Post some sample code that you are trying to convert
Now I have some other problems...
In FastReport 2.5 there are two events called "OnBeginPage" and "OnEndPage"...I search a lot but I can't find anything similar in FastReport 4.0, and the events "OnBeforePrint" and "OnAfterPrint" can't help me. How can I do?
Always in FastRerort 2.5 the component "frPage" has the properties Left, Right, Top and Bottom margin...which are the corresponding properties in FastReport 4.0?
Thanks in advice,
Marco.
In every cause I have to replace the events "OnBeginPage" and "OnEndPage"...and I don't know how can I do this...
Another question...If at runtime I have to add a line inside the report, and that line has to be print inside every page, how can I do?
Thanks in advice to all,
Marco.
titled demo for newbies.
it covers a lot of concepts and should give you some insight.
the onbegin page only fires when a designpage starts it does not fire for out put pages.
if your bands do not stretch(like a preprinted form you can draw lines on an overlay band)
set designer to largeheight in design mode add the overlay(underlay) after all other bands
then add your shapes to the overlay.
var
vPage: TfrxReportPage;
vLine : TfrxLineView;
begin
vPage:=frxReport1.Objects[1];
vLine:=TfrxLineView.Create(nil);
vLine.SetBounds(1,1,100,1);
vPage.Objects.Add(vLine);
frxReport1.PrepareReport;
frxReport1.ShowPreparedReport;
end;
During the prepare report appears an error who said "Invalid pointer operation", can someone say to me if I'm doing something wrong?
Thanks in advice,
Marco
To create line in every page, use following code:
Thanks,
Marco.
I need a conversion guide because otherwise is too difficult for me to convert my code from FastReport 2.5 to 4.0...
Infact I can't find procedures like "vPage.ChangePaper" or properties like "vPage.PrnInfo.Ofx" or "vPage.PrnInfo.Ofy"...
In every case I always can't draw lines inside all pages with the following code:
...lines are printed only in the first page. What I have to do?
thanks in advice to all,
Regards,
Marco.
thank you,
courtney
Because you are creating without specifying a name, they all get a blank name, and only the 1st one survives, and you see no exceptions being raised
Try something like this: