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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula for the group footer.

Status
Not open for further replies.

jmeckley

Programmer
Jul 15, 2002
5,269
US
currently I have the following formula in my report footer
Code:
numberVar total;
if({source.year} = {@current_year}) then total := total + {source.january};
total;
this is duplicated for each month.
I also need to include something similar in group#1 footer. i have tried
Code:
numberVar total;
if({source.year} = {@current_year}) then total := total + sum({source.january},{source.group_a});
total;
but the results are incorrect. the summation is not correct, and the values are not reset between groups.

I have done this before using running totals and defining an Evaluate formula and Resetting on the change of group_a.

I'm trying to do this by formula so I can create the formulas at runtime, instead of manually defining each formula at design time.
Code:
new ReportDocument()
   .DataDefinations
   .FormulaFields["name"]
      .Text = dynamically_create_formula_from(something);

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
The summation formula needs to be in the section where the object you want summed is located, such as the group footer. Then in the report footer you place a display formula:

WhilePrintingRecords;
Numbervar total;

As far as the code goes, you are in the wrong forum, you need to go to the crystal reports integration forum which specifically deals with crystal reports embedded in a VB or .NET project. Probably other languages too.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
The summation formula needs to be in the section where the object you want summed is located, such as the group footer. Then in the report footer you place a display formula:
right, the formula is in the group footer. this is where I want the value displayed. however the calculation I am using (the formula above) is not producing the expected results. i would assume this is because my formula is wrong.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top