Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Report footer formula in group

Status
Not open for further replies.

char473

Technical User
Dec 22, 2006
7
US
I am using Crystal 10

I have the following formula in the report footer

numbervar percentofcommon;
numbervar percentofcommon := ({@printfloorcommon} / {#RTotal1});
numbevar percentofcommon

This formula yields a percentage that need to use in a formula that is placed in a previous group header of the report.

Even simply trying to print the variable in the group header produced unexpected results.

Bottom line, I need to take the results of a formula from the report footer and use it in a formula placed in a group header.

Thanks in advance!!!!
 
Please show the content of your formula {@printfloorcommon} and any nested formulas it contains. Also please specify how the RT is set up. You will not be able to use your current formula in a previous section, but there may be a way to do it with a different approach.

-LB
 
Place the line

whileprintingrecords;

at the start of the formula and see if this gives you the results you are expecting.
 
Here are the formulas being used
@printfloorcommon (placed in report footer)
whileprintingrecords;
numbervar accumfloorcommon;
numbervar accumfloorcommon
@accumfloorcommon (placed in group footer)
whileprintingrecords;
numbervar accumfloorcommon := accumfloorcommon + shared numbervar floorcommon

Shared variable floorcommon represents

whileprintingrecords;
shared numbervar floorcommon := sum({Location_triSpace_TEST____for___testing___space___allocation_.RecordInformation_triAreaNU},{Location_triSpace_TEST____for___testing___space___allocation_.RecordInformation_triParentFloorTX})

What I'm trying to do to prorate an amount to each detail/group record. In order to do that I need to obtain a rate/percent to use based upon the grand total of all values. I was able to calculate this percent at the report footer level but need to utilize this percent in the detail section of the report in a formula.

By the way...I really appreciate all your help!!!!
 
Why are you using a shared variable? Is the shared variable coming from a subreport?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top