Results 1 to 2 of 2

Thread: [Resolved] Showing sum in Crystal Reports group header

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    50

    [Resolved] Showing sum in Crystal Reports group header

    I have one formula which basically sums up another formula. This gives me the correct numbers. Then I have another formula which I attempt to display the sum and reset the counter. However I would like the sum to show in one of my group headers, but of course if I put the formula into the header, the total only correctly shows in the next group header, so all of the records are off by one. Is there a way in Crystal to make those appear in the header? The formulas are as follows:

    This one computes the sum and is located in the group footer:
    numbervar SumSales;
    SumSales := SumSales + {@MonthlySales};

    This one to display which works incorrectly when placed in group header:
    whileprintingrecords;
    global numbervar SumSales;
    numbervar DispSales;

    DispSales := SumSales;
    SumSales := 0;
    DispSales;
    Last edited by BIGGY; May 4th, 2006 at 10:57 AM.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Showing sum in Crystal Reports group header

    Crystal will handle everything for you. You may not need to create any extra formulas. Is @MonthlySales displayed on the report?

    If yes, right click @MonthlySales and select Insert Summary. Set the required options and a new field will automatically be created in the Group Footer. Simply move this field to the Group Header.


    If you want to create a formula yourself this is really all you need.

    Sum ({@MonthlySales}, {Customers.CompanyName} )
    -> Customers.CompanyName is the same field as your Group.

    Then print this formula in the Group Header.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width