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?!
I've done this in an Access report and it works fine, but it only "almost" works in CR.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
Any Ideas?????




Reply With Quote