|
-
May 13th, 2003, 03:46 PM
#1
Thread Starter
Fanatic Member
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:
'This code is in my report
'Away1 is a Field on my report
'lAway is an long variable that keeps count of how many Away1's occured
'txtAwaySum is a label in the page footer that holds the total for that page
Dim lAway As Long
Private Sub Report_Initialize()
'Initialize the variable to 0 when the report opens
lAway = 0
End Sub
Private Sub Detail_Format(ByVal pFormattingInfo As Object)
'Increment the variable if the field matches certain criteria
If Away1.value = "X" Then lAway = lAway + 1
End Sub
Private Sub pgFtr_Format(ByVal pFormattingInfo As Object)
'Set the text for the summary field in the page footer
txtAwaySum.SetText CStr(lAway)
'Re-Initialize the variable back to 0 for the next page
lAway = 0
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
-
May 14th, 2003, 08:45 AM
#2
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|