WHOOOHOOO!
With someone's help on the MS website, I finally figured out how to create variables and set them summable/countable. I'm posting here in the hopes I can save someone else the grief. @=)
Go to Report Properties -> Code tab. Then you have to create a series of functions (not DIM a variable) that will increment your counter, reset your counter and display your counter.
The basic syntax is as follows:
Only use one of the two above Return statements. If you just want to display the variable (anywhere on your report), omit the increment portion of that code. If you want to Reset the variable, create a function that has a "<VariableName> = 0" and uses the blank Return statement.
I set my reset into the footer, set the increment into the header, didn't display it at all, but used the counter in a visibility property: IIF(Counter <= 1, False, True) to resolve my group header printing in the middle of the page problem.
I hope this helps someone. Let me know if you need clarification!
Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???
With someone's help on the MS website, I finally figured out how to create variables and set them summable/countable. I'm posting here in the hopes I can save someone else the grief. @=)
Go to Report Properties -> Code tab. Then you have to create a series of functions (not DIM a variable) that will increment your counter, reset your counter and display your counter.
The basic syntax is as follows:
Code:
--- Note: Public and Shared are ESSENTIALLY keywords
--- without them, the code won't work throughout the whole
--- report!!!
Public Shared <VariableName> as <datatype>
-- For a counter, use INT
Public Shared Function <FunctionName>() as String
<VariableName> += 1
-- += is equivlant to the T-SQL "Set Num = Num + 1"
Return <VariableName>.ToString
-- This is a select stmt that calls the function
-- as a string returned variable
Return ""
-- This can be used as an alternative to the above
-- to return/display nothing.
END Function
Only use one of the two above Return statements. If you just want to display the variable (anywhere on your report), omit the increment portion of that code. If you want to Reset the variable, create a function that has a "<VariableName> = 0" and uses the blank Return statement.
I set my reset into the footer, set the increment into the header, didn't display it at all, but used the counter in a visibility property: IIF(Counter <= 1, False, True) to resolve my group header printing in the middle of the page problem.
I hope this helps someone. Let me know if you need clarification!
Catadmin - MCDBA, MCSA
"If a person is Microsoft Certified, does that mean that Microsoft pays the bills for the funny white jackets that tie in the back???