In some inherited code, I see group headers/footers have items like 'Sum of @numcount
' . I cannot get the sum of a formula field. Any thoughts?
In the Formulas section, provide an alias for the field that stores the sum, and then select Number as the field type. Select the Sum function, place the cursor within the parenthesis, and then select the field for which you want to calculate the sum. For example, to calculate the sum of amount, use SUM({Amount}).
You can right click the field object either in the Field Explorer or on the report canvas and select “Find in Formulas”. The other way to access the formula search is to click on the “binoculars” or press Control-F while you are in the Formula Editor.
The only reason that I know of why a formula wouldn't be available to summarize on is if it didn't reference any database fields or whose value wasn't dynamic throughout sections of the report. For example, if you have a formula that returns a constant it won't be available. Or if it only references a field that is set throughout the report and returns a value based on that field, like "if {parameter}=1 then 1" would not be available either.
In general, the formula's value should not be static through the sections of the report you're summarizing over (Though the way Crystal determines this is beyond me and this doesn't seem to be a hard and fast rule)
EDIT: One other reason why a formula wouldn't be available is if you're already using a summary function in that formula. Only one level of summaries at a time!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With