Print Page | Close Window

How to add Summary of a field in Report footer?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=7034
Printed Date: 03 May 2024 at 1:08pm


Topic: How to add Summary of a field in Report footer?
Posted By: GowthamSen
Subject: How to add Summary of a field in Report footer?
Date Posted: 14 Jul 2009 at 10:39am
Hi,
 
I am trying to add a Summary of a field.
 
The scenario is like this.
 
I have two fields "Employee", "Score". Which can contain negative values and Positive values.  Each employee can have multiple scores. I need to show Maximum of Score in detail section for each employee.
 
So, I inserted a object with Summary option as Maximum.
 
This is working as expected.
 
And in the report filter, I need to display Sum (Max of Score for each employee ).
 
But its summing all the values. Is there any way we can solve this?
 
 
Thank you,
Regards,
 
Gowtham Sen.


-------------
Thank you
Regards,

Gowtham Sen.



Replies:
Posted By: lockwelle
Date Posted: 14 Jul 2009 at 11:08am
little confused on the report filter, but I believe that what you are saying is that sum is summing all scores, not just the max for each employee.  You can do this with shared variables, and probably running totals, but I am not real good with RTs, that is DBlank's forte.
 
For shared variables, you would build a formula that will 'replace' the aggregate for Max.
The formula would look like;
 
local numbervar thisTotal:=MAXIMUM({table.Score}, EmployeeGroup);
shared numbervar MaxTotal:=MaxTotal + thisTotal;
thisTotal
 
Where you want the sum of maxes, build another formula:
shared numbervar MaxTotal
 
HTH
 


Posted By: GowthamSen
Date Posted: 14 Jul 2009 at 11:20am
Hi LockWelle,
 
Here I would like to summ only the max scores only.
 
I have 2 cross tabs.
One is in Report Header and Another one is in Report Footer.
 
In Report Header, I am displaying all employees with maximu scores.
 
In Report Footer, I need to display only sum of Maximum score of each employee.
 
For example:
 
EmpNo ---- Score
----------------------
101   ----  5
101   ---- -4
101   ----  6
102   ----  1
102   ---- -4
102   ----  0
 
So in Report header I should display
EmpNo ---- Score
----------------------
101   ----  6
102   ----  1
 
And in report footer, I should display,
 
Score
-------
7
 
Thank you,
Regards,
 
Gowtham Sen.


-------------
Thank you
Regards,

Gowtham Sen.


Posted By: GowthamSen
Date Posted: 14 Jul 2009 at 12:40pm
Hi Lockwelle,
 
I tried the way you mentioned. But its returning 0.
 
The formula is as follows.
 
formula1:
 
Local numbervar ThisTotal:=Maximum ({Query1.Score}, {Query1.Employee});
Shared numbervar MaxTotal:=MaxTotal+ThisTotal;
ThisTotal
 
Formula2:
 
Created another formula as follows.
Shared numbervar MaxTotal
 
I used the "Formula2" in crosstab summary field.
 
Its returning 0. Am I missing any thing.
 
Thanks a lot!
 


-------------
Thank you
Regards,

Gowtham Sen.


Posted By: lockwelle
Date Posted: 14 Jul 2009 at 1:45pm
Since you are using crosstabs, I can't guarantee that things will work, as I don't use crosstabs.
 
where are you applying formula1?  Is formula displaying the correct value? if not, nothing is going to work from there on out.  try just getting the max to work correctly.  It should work in a section header...is it in the Employee group header?



Print Page | Close Window