How to find RecordCount?

Hi all,
I want to access the recordcount of MasterDataBand's dataset at OnBeforPrint event of a ReportSummary band. How can I do this?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:00AM
    here is a sample on the reports code page

    var
    masterecordcount:integer; //declare global var

    procedure ReportSummary1OnBeforePrint(Sender: TfrxComponent);
    begin
    memo7.memo.clear;// how to clear a text objects memo
    memo7.memo.add('[masterecordcount]'); // add var to text object
    // use in an expression
    // if masterecordcount = somevalue then
    end;

    procedure Band2OnAfterPrint(Sender: TfrxComponent);
    begin
    inc(masterecordcount);// increment var
    end;

    begin
    masterecordcount:= 0;// initialize
    end.

    here is another sample for your previous post

    procedure Footer1OnBeforePrint(Sender: TfrxComponent);
    begin
    While engine.FreeSpace - (footer1.height + Child1.height) > child1.height do
    begin
    with Engine do showband(child1);
    end;
    end;
    ;)

  • edited 11:00AM
    You can send RecordCount of the Query through a variable too...

    regards.
  • gordkgordk St.Catherines On. Canada.
    edited 11:00AM
    Yes you can. However if you are hiding any bands then you may get a bad count.
    ;)

Leave a Comment