Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Putting a sum before the details in Crystal Reports

Posted on 2009-06-30
7
Medium Priority
?
353 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
[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
7 Comments
 
LVL 2

Accepted Solution

by:
vetaldj earned 2000 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 23

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 101

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 35

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

610 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