Cannot Summarize a Subreport Summary Field

Posted on 2006-04-12
Last Modified: 2008-02-01
I have several assemblies that each require multiple components.  I am calculating The extended cost per assembly in a subreport.  The subreport has the cost per component calculated by @costper := QuantityPer*STDCost.  Then I have the footer summing the total cost per assembly as Sum(@costper).  Next I have a calculation of Value Remaining as Sum ({@compCostperAss})*{?Pm-@Balance}.  This last item is being passed from the main report and is calculating what is left.  So that if I have built 5 assemblies but need 10, I am getting the value of the work left.  I am passing it to the main report as a formula in the footer:

Shared NumberVar SubTotal;
Subtotal := Sum ({@compCostperAss})*{?Pm-@Balance};

What I want to do now is show a total sum of this last item in the main report.  In details B I have a supressed field that shows:

Shared NumberVar Subtotal;

But when I try to summarize the field above in the main report it says "This field cannot be summarized."

300 pts because it's urgent!

Question by:zrivera
    LVL 42

    Accepted Solution

    You cannot summarize any formula that is calculated during the WhilePrintingRecords step because that's the last step of the report engine.  What you'll want to do is add a variable and calculate your total manually.  Something like this:

    Shared NumberVar Subtotal;
    Shared NumberVar Grandtotal;
    Grandtotal := Grandtotal + Subtotal;

    Then you can show the total in the bottom of the report with the Grandtotal variable.

    Author Comment

    That did the trick, thanks!

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    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…
    Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video discusses moving either the default database or any database to a new volume.

    730 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

    15 Experts available now in Live!

    Get 1:1 Help Now