i have problem with line#

edited 11:09AM in FastReport 4.0
Hi.
see this code:
var myline:integer;

procedure PageHeader1OnBeforePrint(Sender: TfrxComponent);
begin
  myline:= 0;
end;

procedure Memo12OnBeforePrint(Sender: TfrxComponent);
begin
  inc(myline);
  Memo12.text:=inttostr(myline);
end;

but when report is run:
show number like this:

page1:
1
2
3
page2:
4
1
2
3
page3:
4
1
2
3
...

please help me
i want to show this page like:
page1:
1
2
3
...
page2
1
2
3
...
page3:
1
2
3
...

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:09AM
    you are not having a problem with the fr variable line#
    you have a problem with where you reset your own variable to 0
    use the correct event of the page header. it should be in OAP
  • edited 11:09AM
    thank you dear gordk!
    but how to solve this problem
    please help me.
  • gordkgordk St.Catherines On. Canada.
    edited 11:09AM
    procedure PageHeader1OnAfterPrint(Sender: TfrxComponent);
    begin
    myline:= 0;
    end;

    btw memo12 does not need to use code to get a value all it needs to contain is [myline]
  • edited April 2009
    but how to print numbers?
    memo12.text print myline value in report.
    var myline:integer;
    procedure MasterData1OnBeforePrint(Sender: TfrxComponent);
    begin
      inc(myline);
      Memo12.text :=inttostr(myline);              
    end;
    procedure PageHeader1OnAfterPrint(Sender: TfrxComponent);
    begin
      myline := 0;  
    end;
    

    dear qordk:
    i use your code but dont solve my problem.
  • edited 11:09AM
    any can help me?

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.