Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Summaries and Ranges Post Reply Post New Topic
Author Message
JDodd
Newbie
Newbie


Joined: 01 Mar 2007
Online Status: Offline
Posts: 15
Quote JDodd Replybullet Topic: Summaries and Ranges
    Posted: 12 Dec 2007 at 11:51am
Here is what I need to do.  I have a file that consists of contract number, Item code and charged amount.  What I want is to first sum the charge amounts for the contract giving me a total value of the contract.  Then sum the total value of the contract based on ranges 1 - 10,000, 10,001 - 20,000 and so on.  The final result will give me a total value of the contracts that are in these individual ranges.
 
In other word all of the contracts with a value between 1 and 10,000 add up to this amount.
 
How can this be done?
 
Thanks in advance for your help
 
Joe
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 13 Dec 2007 at 12:05am
Have you tried using a cross-tab object? First you need to create a formula which breaks out the contract ranges into categories. Then do the cross-tab using the category formula as the row and use the charged amount as the column. Then you can do summaries and percentage calculations across the group based on category.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
JDodd
Newbie
Newbie


Joined: 01 Mar 2007
Online Status: Offline
Posts: 15
Quote JDodd Replybullet Posted: 14 Dec 2007 at 6:58am

Hi Brian,

First of all thank you for the reply.
 
It sounds like that would work.  What I ended up doing is building the totals by contract with a command and then using the group order, in specified order, basically to just format the data and to set up the ranges.  I seem to use the Add Command option in the database expert more and morere often.  Don't know if that is a good thing or not.
 
Is there any down side to doing that other than the next person to work on the report needs to know SQL in order to change it?
 
Thanks so much.
 
joe
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 14 Dec 2007 at 9:09am
I think you're just fine using the Command object as the data source. Since you're becoming more familiar with it then you'll be able to keep writing more advanced SQL queries. The other thing to consider is that if you have access to the database, then you can create stored procedures instead. This helps consolidate all your SQL in a central location and maintenance is easier than having to track down SQL in various reports that may have been distributed out.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.