Solved

Subreport in Crystal passing data and need to build an average in Main Report

Posted on 2012-03-14
5
275 Views
Last Modified: 2012-03-14
Subreport formula:

 if({CallDetail.InternalNum})  > 600 and ({CallDetail.InternalNum}) <=700 then
0 else {CallDetail.Duration}

I've added the subreport in the DETAILS section on my MAIN REPORT

I need to now calculate an average for everything that was passed in my REPORT FOOTER

Is this possible?  If so, could someone provide complete details on how to do this?

Thanks in advance..
0
Comment
Question by:wshcraft70
  • 3
  • 2
5 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 37722503
In the report header add a formula
WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;
""

IN the subreport modify your formula

WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;
Local NumberVar CallDuration;

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

In the report footer
WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;
If RecCount = 0 then
    0
Else
    DurationTotal / RecCount

mlmcc
0
 
LVL 1

Author Comment

by:wshcraft70
ID: 37722560
I've got this on a group and I need the record count to be reset for my average per group record..

Where would I add this?

Visuals are awesome..  ;)

Thank you soooooo much..
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 37722609
Put the display/avverage calculation formula in the group footer

In the group header add this formula to reset the values
WhilePrintingRecords;
Shared NumberVar RecCount;
Shared NumberVar DurationTotal;
RecCount := 0;
DurationTotal := 0;
""
0
 
LVL 1

Author Comment

by:wshcraft70
ID: 37722634
I cannot get the average Talk Time to calculate..  For some reason, the group rec count doesn't seems to be resetting..  Below is what I have..  Do you see where I've gone wrong?

Currently:

Report 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
 
LVL 1

Author Comment

by:wshcraft70
ID: 37722700
I dropped the Report Header down to the Group Header and I'm now GOOD TO GO..  :D

Thanks for everything..
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now