Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Report Totals Post Reply Post New Topic
Author Message
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 72
Quote brockloch Replybullet Topic: Report Totals
    Posted: 22 Sep 2021 at 1:15am
Hi

I have a report that shows all the orders for a range of products. I also have the available stock of each product. The grand total of the product is incorrect e.g if I have 10 in stock of one product and 10 in stock of another product they are both used in 3 orders. If I add a grand total, of what is in stock it should be 20, however it is coming out as 60, as there are 3 instances of each. Hope that makes sense. Any help much appreciated.
Ed
brockloch
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4351
Quote lockwelle Replybullet Posted: 22 Sep 2021 at 8:32am
how are getting the data? Is the report joining to the tables directly or from a stored procedure?

If from a stored procedure, I would create a column and populate it so that the total comes out correctly (easier said than done...).

Otherwise, I would try a subreport that would look at the items, and not be concerned about the duplication caused by the usage.

Some possible solutions, I am sure that there are more.

HTH
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 72
Quote brockloch Replybullet Posted: 22 Sep 2021 at 9:13am
Thank you for your help. It's directly from the tables, I think I may have to look at sub reports - or send it to excel and total it there.

Thanks again.
brockloch
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Sep 2021 at 3:02am
you can also possibly use running totals. Create a RT as a sum of the field but evaluate on change of the PK from the table that identifies the stock not the orders
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 72
Quote brockloch Replybullet Posted: 05 Oct 2021 at 11:46pm
Thank you I will try that.
brockloch
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.047 seconds.