Results 1 to 2 of 2

Thread: Another Crystal Report Question!

  1. #1

    Thread Starter
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016

    Another Crystal Report Question!

    I'm entirely new to Crystal Reports, so don't tie me up to the whipping post too quickly.

    I have a report in CR 9 that will potentially be multiple pages. I would like to include on each page a total for certain columns on that page. I've placed "summary" columns in the report footer and added code to the footer format sub so that these fields are populated each time the footer is formated.

    The problem is that the first line of the next page is included in the totals for the current page! I don't know why it's putting it there or how to take it off. Can someone PLEASE help me?!
    VB Code:
    1. 'This code is in my report
    2. 'Away1 is a Field on my report
    3. 'lAway is an long variable that keeps count of how many Away1's occured
    4. 'txtAwaySum is a label in the page footer that holds the total for that page
    5.  
    6. Dim lAway As Long
    7.  
    8. Private Sub Report_Initialize()
    9.      'Initialize the variable to 0 when the report opens
    10.      lAway = 0
    11. End Sub
    12.  
    13. Private Sub Detail_Format(ByVal pFormattingInfo As Object)
    14.     'Increment the variable if the field matches certain criteria
    15.     If Away1.value = "X" Then lAway = lAway + 1
    16. End Sub
    17.  
    18. Private Sub pgFtr_Format(ByVal pFormattingInfo As Object)
    19.     'Set the text for the summary field in the page footer
    20.     txtAwaySum.SetText CStr(lAway)
    21.  
    22.     'Re-Initialize the variable back to 0 for the next page
    23.     lAway = 0
    24. End Sub
    I've done this in an Access report and it works fine, but it only "almost" works in CR.

    Any Ideas?????
    Chris

    Master Of My Domain
    Got A Question? Look Here First

  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Posts
    178
    In 8.5, this is called a running total.

    Search Crystal Help for 'running total' and it will provide you with instuctions.

Posting Permissions

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



Click Here to Expand Forum to Full Width