just drag the field from the elements box into the footer
You should be able to use the GetCell command in your footer. If the sum isn't already calculated, just calculate on another (hidden) row.
I've never seen code like that before. Perhaps we need more clarity regarding what software the question was about and what software your answer was for.
My response assumed the question was about a newer version (9 and up) of Hyperion Interactive Reporting Studio or Web Client.
I was thinking for Financial Reporting Studio. If not, then ignore.