Create of Objects in Engine.PreviewPages

edited 8:55AM in FastReport 3.0
Hi!

I would like to print a code with TfrxLineView-Objects to my prepared Report. I use the OnProgressStop-Event.
procedure TfrxKuvertierReport.PProgressStop(Sender: TfrxReport; ProgressType: TfrxProgressType; Progress: Integer);
var Page: TfrxReportPage;
    Line: TfrxLineView;
    PCount, LCount:Integer;
begin
  for PCount:=0 to Sender.Engine.TotalPages-1 do
  begin
    Page:=TfrxReportPage(Sender.Engine.PreviewPages.Page[PCount]);
    for LCount:=1 to 15 do  //15 Lines
    begin
      (LCount in [1,15]) or
      ((LCount=14) and (Page.FindBand(TfrxFooter)<>Nil)) or
      ((LCount=13) and (Page.FindBand(TfrxFooter)=Nil)) or
      ((LCount=12) and (PSequenz in [8,9,10,11,12,13,14,15])) or
      ((LCount=11) and (PSequenz in [4,5,6,7,12,13,14,15])) or
      ((LCount=10) and (PSequenz in [2,3,6,7,10,11,14,15])) or
      ((LCount=9)  and (PSequenz in [1,3,5,7,9,11,13,15])) or
      ((LCount=2) and (Page.FindBand(TfrxHeader)<>Nil)) then
      begin
        Line:=TfrxLineView.Create(Page);
        Line.CreateUniqueName;
        Line.SetBounds(0,LineStart+(LineDistance*LCount),LineLength,0);
      end;
    end;
    if Sequenz<15 then inc(PSequenz) else PSequenz:=1;
  end;
end;
2 Problems:
- In the preview-window the Lines are not displayed correctly, if the report have more then 50 Pages.
- Only the first printed page have correct Lines, all other Pages are printed without the Lines

Thanks and sorry for my bad english

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.