Alpha Video Training
Results 1 to 4 of 4

Thread: count of records on each page

  1. #1
    Member
    Real Name
    Michael Pesach
    Join Date
    Apr 2000
    Posts
    145

    Default count of records on each page

    I am looking for some way of getting the count of records in a report for on each page. So that if there 25 records on page one in the footer it should show 25 and if the next is 26 it show it.

    Thanks for your help

  2. #2
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default RE: count of records on each page

    I believe you want the run_count function (p. 451, Xbasic manual).

  3. #3
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default RE: count of records on each page

    Michael,

    What you need to know is the count at the end of the previous page and at the end of the current page, then subtract the two for the count for the current page. The running count of anything will give you the current count.

    I have not tried this, The previous page's count can be gotten as such.

    Place a calculated field on the report's page footer that uses a function like

    Name Expression
    calcfield lastpagecount(currentrunningcount)

    Where the function is defined like this;

    function lastpagecount as N(currentcount as N)
    dim global lastcount as N
    lastpagecount=lastcount
    lastcount=currentcount
    end function

    Before starting the report, zero lastcount in a script.

    The biggest issue is whether the function is called multiple times for each record when running the report. If this is so, then you need to set a flag that returns the correct value only when the last record (or mrecno()) changes, and otherwise returns the previous value.

    Regards & Happy 4th of July!

    Ira J. Perlow
    Computer Systems Design & Associates
    csda@mediaone.net

  4. #4
    Member
    Real Name
    Michael Pesach
    Join Date
    Apr 2000
    Posts
    145

    Default RE: count of records on each page

    Ira;

    Great Idea However, when you I put this function (or a variation of it) into the report Alpha took the function and ran it multiple times. so that it would reset the currentcount would be evaluated few time and would get different numbers. I did reset the lastcount in the oninit of the report here is the function that doest work

    function lastpagecount as N()

    t = table.current()
    debug(1)
    dim global lastcount as n
    if lastcount > 100000
    lastcount = 0
    end if
    currentcount = run_count(t.tent_code)
    lastpagecount=currentcount - lastcount
    lastcount=currentcount

    end function

    Thanks for your Help

Similar Threads

  1. Count records
    By Amateur in forum Alpha Five Version 5
    Replies: 11
    Last Post: 09-12-2004, 08:44 PM
  2. Report Running Total Page Count
    By Barbara Dansby in forum Alpha Five Versions 2 and 3
    Replies: 5
    Last Post: 03-15-2002, 05:55 PM
  3. count records
    By crimmelcp in forum Alpha Five Version 4
    Replies: 7
    Last Post: 04-18-2001, 03:11 AM
  4. Exceeded user count and invalid page fault
    By richardurban in forum Alpha Five Version 4
    Replies: 2
    Last Post: 08-04-2000, 06:54 PM
  5. Count of records.
    By Rodney Efird in forum Alpha Five Version 4
    Replies: 1
    Last Post: 05-17-2000, 07:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •