cancel
Showing results for 
Search instead for 
Did you mean: 

Grand total of manual subtotal

Former Member
0 Kudos

Dear all,

I have a report which contains manual sub total which I have worked out from the help file given in Crystal report. The manual Sub total is working fine however I would like to have a grand total of all the sub totals.

The report is grouped by a reason code, under each reason code, total number of jobs and lenses are being calculated. At the end each total number of jobs get added up making up a sub total.

Now at the end of the report I would like to have a Grand total.

For example:

Code 1

1

2

3

---

6 (sub total)

Code 2

2

3

5

---

10 (Sub total)

Grand total = 16

The sub total is working out fine however how can you get a grand total of this manual running total.

Regards

Jehanzeb

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

As I understand you have created groups and in group footer you have placed the sub total and you want total sum of all sub total.

I would suggest you to create summary field and check the option "Add to all group levels".This option will give you sub total at the group footer section and Grand total at the report footer section.

Hope it helps!!!!

Regards

Asha.

Former Member
0 Kudos

Asha you are right, I have nearly 5 different groups however they all are suppressed. I am using only one Open Group Footer.

The reason is because I need to show averages per job/lenses for different time scales. For example Daily basis, Month to date, year to date, last 5 days etc.

What I have done is, I created each group and entered only Running Total in them and then used a manual formula given above to calculate the averages.

I think what I need is somewhat similar to what Brian suggested however I don't know how to implement it.

Oh and If I take the report header reset out, the grand total only looks at the last sub total and not all the sub totals.

Here is the screenshot of it to make things easier to understand.

[SCREENSHOT|http://i46.photobucket.com/albums/f115/jaytheguru/grandtotalissue.jpg]

Regards

Jehanzeb

Answers (3)

Answers (3)

Former Member
0 Kudos

Ok I have created same formulas twice and kept them into the same group footer and as suggested I did not reset them, and guess what!

Result!

Atlast, the grand total is appearing to be right. I am going to check it again.

Checked...and it is correct.

Former Member
0 Kudos

simply do another manual running total (same way you did the sub-totals) for the grand total. Just don't reset it.

Former Member
0 Kudos

Add another variable to the formula that calculates the subtotal.

global numbervar grand_total;

grand_total := grand_total + sub_total;

sub_total can be either the variable you are using or whatever you are adding to the sub total variable.

Add a new formula that will display the grand_total, and place it in the report footer:

//@Display Grand Total

whileprintingrecords;

global numbervar grand_total;

Former Member
0 Kudos

Thanks Brian,

I think I am doing it totally wrong. Some reason it is keep on adding the previous subtotal and grandtotal togeather and producing big results.

Here is what I am doing for sub total

Group Header contains the following reset formula


Whileprintingrecords;
Global Numbervar JAvg:=0;
Global Numbervar JMTDAvg:=0;
Global Numbervar JYTDAvg:=0;
Global Numbervar JL4WAvg:=0;
Global Numbervar JLFWAvg:=0;
Global Numbervar FAvg:=0;
Global Numbervar FMTDAvg:=0;
Global Numbervar FYTDAvg:=0;
Global Numbervar FL4WAvg:=0;
Global Numbervar FLFWAvg:=0;

Group Footer contains the following formula


Whileprintingrecords;
Numbervar JAvg;
Numbervar myaverage=0;
Numbervar CAvg=0;
myaverage := {#Total Jobs};  
CAvg:= myaverage /{@WorkingDays};
JAvg:=JAvg + CAvg;
CAvg

Group footer 1 contians the following code


Whileprintingrecords;
Numbervar JAvg;

Where should I put the code you have told me.

Regards

Jehanzeb