Solved

Crystal Reports with summary and sub-footer (continuation assistance required)

Posted on 2012-03-14
3
309 Views
Last Modified: 2012-03-15
Currently:

However, Initially, I was instructed to calculate the average talk time..  However, what I really need is the TOTAL AVG TALK TIME for the ENTIRE group..

So I currently I'm able to calculate the avg on the change of each group..

But I need it to provide to AVG of the groups in the Footer..

Also, I don't want to display the details and just the footer.  How can I do this?  When suppresseing because I'm "WHILEPRINTINGRECORDS" everything goes to zero..  :(

Group Header:

WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;
RecCount := 0;
DurationTotal := 0;

Sub Report:

whileprintingrecords;
shared numbervar RecCount;
shared numbervar DurationTotal;
Local NumberVar CallDuration;

if({CallDetail.InternalNum})  >= 600 and ({CallDetail.InternalNum}) <700 then
     CallDuration := {CallDetail.Duration}
else
    CallDuration := 0;
if CallDuration > 0 then
  RecCount := RecCount + 1;
DurationTotal := DurationTotal + CallDuration;
CallDuration


Group Footer:


WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;

If RecCount = 0 then
    0
Else
   DurationTotal / RecCount;
0
Comment
Question by:wshcraft70
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
James0628 earned 500 total points
ID: 37723637
What do you mean by "ENTIRE group"?  It seems like you should be getting the average for each group.  Do you mean an average for the entire report (all groups combined)?  If so, and if you don't need the average for each group, try moving the formula that's in the group header (which sets the variables to 0) to the report header (or just remove the formula from the group header, if you already have a similar formula in the report header).

 As for not displaying the details and footer, I don't think that should have any effect on the formulas in the main report.  I don't think suppressing a section has anything to do with WhilePrintingRecords.

 However, if you suppress the section that a subreport is in, the subreport won't be run.  Maybe that's your problem.  If so:
 Suppress every section in the subreport, so that it doesn't produce any output.
 Right-click on the subreport, select "Format Subreport" and on the Subreport tab, check the "Suppress Blank Subreport" option.
 Make sure that anything else that's in the same section as the subreport is suppressed.
 Go to the Section Expert for the section that the subreport is in and check the "Suppress Blank Section" option.

 That way, the subreport will be run and will set your variables, but it won't produce any output, so the subreport will be suppressed, so the section will be suppressed.

 James
0
 
LVL 1

Author Closing Comment

by:wshcraft70
ID: 37724713
Yes, moving the formulas from one footer to the other get me ALL THE TIME..  I worked that part out..  However, thank you VERY much for the information about suppressing the SR..  When I was suppressing the entire section, you're right, the SR was not running thus no details.  So doing it in the order of events above did the trick..  Much thanks!!
0
 
LVL 35

Expert Comment

by:James0628
ID: 37727919
You're welcome.  Glad I could help.

 James
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
across tab - Distinct Count - Crystal Reports 2 90
Mask on Parameter CR2008 28 71
A string is required here error 20 26
Crystal reports login after closing form 3 34
Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question