Solved

Putting a sum before the details in Crystal Reports

Posted on 2009-06-30
7
347 Views
Last Modified: 2012-05-07
Hi

I am producing a Crystal Report, and need to show the "Total Weight" at the top of the report. However the data for this calculation is in the details that come after it, so the value is not calculated correctly

If i put it at the bottom, after the details, it calculates fine, but that's not allowed for this unfortunately

How can i calculate this correctly and show it in the right position?

Thanks

Scott
0
Comment
Question by:seancurt
7 Comments
 
LVL 2

Accepted Solution

by:
vetaldj earned 500 total points
ID: 24746381
You can create a formula and place it to the Report Header with something like this inside(depends what you need):

WhilePrintingRecords;
Sum(<your field>)

It should works. You can provide what exectly you calculation should do so we can provide you with more accurate formula.
0
 
LVL 22

Expert Comment

by:Ido Millet
ID: 24746597
You are probably using a Running Total.  Change the approach to a conditional total or, if this is not possible in your case, use a subreport.

If you describe the logic of the total it would be easier to address your question.
0
 
LVL 5

Expert Comment

by:dhobale
ID: 24748741
Hi Scott,
You will have to export your report to a table in database and recreate it. Just like creating table of content / index table for crystal report. Without it, you won't be able to display total in header.
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 5

Expert Comment

by:dhobale
ID: 24748808
There is an interesting article regarding your question here:

http://kenhamady.com/cru/archives/304

see if it works for you.
0
 

Author Comment

by:seancurt
ID: 24753063
Vetaljd solution has sort of worked, was able to get the sum to show correctly, until i realized i wasn't suming my group correctly. So i changed the sum in my group:-

CDbl (({#TotalQtyGroup}*{@ItemSizeNo})/1000);

to produce a net weight formula.

Now the report won't let me summarize the net weight formula. It says that this field cannot be summarized.:-

WhilePrintingRecords;
Sum({@Net Weight})
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 24759643
Running totals are calculated in the last pass through the report and the value isn't known until the report is complete.   Since the summaries are run in an earlier pass they running totals can't be summarized.

You will have to do a manual summary using formulas and variables.

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
ID: 24769149
What do the {#TotalQtyGroup} running total and the {@ItemSizeNo} formula look like?  It might be possible to change your current formula to something that can be summarized.  That's the only way to get a total based on the data in this report at the _top_ of the report.  You could do a "manual summary", as mlmcc suggested, but if your calculations are based on a running total, you're not going to get your total until the end of the report.

 If you have to use a running total in the calculation, you may have to use a subreport.  You'd put the subreport in the report header and it would read essentially the same data as the main report and produce the total for you.

 James
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 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