We help IT Professionals succeed at work.

How to sum records for Group Footer in crystal report

wasabi3689
wasabi3689 asked
on
277 Views
Last Modified: 2008-07-15
D-Dertail
GH-Group Header
GF-Group Footer
RF - report footer

I created a report group by book_value_code ( should have 3 different codes) and asset_id with date range selection

In D section, it produces a list of assets. In GF, section, I max(asset_id), min(net_book_value). It will produce the right set of data.

But, I want to sum some numbers in GF section. For example

After the date range selected, it produces 2 records asset 123 and 246
                                        net_book_value
asset_id 123
GF2       .....                               200
asset_id 246
GF2                                           246

GF 1                                         1000  ( it sum not only 123 and 246 )

How can I sum only 123 and 246?



Comment
Watch Question

Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
where to put your formulas?

Do I need to create new under formulas field?

Please more specific
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
Create them
DIsplay the field explorer
Right click formula
Click NEW
ENter the formulas as stated and drag them to the sections stated.

mlmcc

Author

Commented:
I created a new formula named GH1 and put

WhilePrintingRecords;
Global NumberVar Group1Total
Group1Total := 0;

But it say:" this is an error in the formula"

I created GF2 as

WhilePrintingRecords;
Global NumberVar Group1Total
Group1Total := Group1Total  + max(net_book_value);

But it say:" this is an error in the formula"

I created GF1 as

WhilePrintingRecords;
Global NumberVar Group1Total
Group1Total

But it say:" this is an error in the formula"


Why?
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
There is a ; missing
GH1
WhilePrintingRecords;
Global NumberVar Group1Total;
Group1Total := 0;

GF2
WhilePrintingRecords;
Global NumberVar Group1Total;
Group1Total := Group1Total  + max(net_book_value);

mlmcc

Author

Commented:
It seems your formulas can only pick one record in Group footer. If I have several records in the group footer, it seems it doesn't work for other. So far I can make it work for one (Original_cost), but when I change to net_book_value, it doesn't work.

Here it's my formulas for original cost, it works

GF1_Original_Cost

WhilePrintingRecords;
Global NumberVar Group1Total;
Group1Total;


GF2_Original_cost

WhilePrintingRecords;
Global NumberVar Group1Total;
Group1Total := Group1Total+ ({XX_ASSETS_DEPRECIATION_V.ORIGINAL_COST});

GH1_Original_cost

WhilePrintingRecords;
Global NumberVar Group1Total;
Group1Total := 0;

For Net_Book_Value, I change Group1Tota to Group2Total, but it doesn't work


GF1_Net_Book_Value

WhilePrintingRecords;
Global NumberVar Group2Total;
Group2Total;


GF2_Net_Book_Value

WhilePrintingRecords;
Global NumberVar Group2Total;
Group2Total := Group2Total+ ({XX_ASSETS_DEPRECIATION_V.Net_Book_Value});

GH1_Net_Book_Value

WhilePrintingRecords;
Global NumberVar Group2Total;
Group2Total := 0;

What is wrong with it?
Mike McCrackenSenior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013

Commented:
What isn't working?

mlmcc

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.