Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: adding values from another subreport Post Reply Post New Topic
Author Message
TheBig1980s
Newbie
Newbie


Joined: 13 Nov 2008
Location: United States
Online Status: Offline
Posts: 4
Quote TheBig1980s Replybullet Topic: adding values from another subreport
    Posted: 19 Apr 2010 at 9:20am
Hello:
 
I have a Crystal XI report containing inventory items.  These items come from a SQL 2005 table.

In this report, I also have a subreport that pulls the item quantities from an Excel spreadsheet. These items and quantities are in a group footer.  When I generate this report, the data in both the main report and the subreport are correct.

In this main report, below this group footer, I have placed another group footer that needs to show customer totals.  I need to have this footer show the quantities, in total, for all items for each customer.
 
The problem, though, is that the "MainReportTotal" is from another subreport.  You see, I'm trying to total item quantities per customer.  The problem is that those quantities are from a subreport in another group footer--not simply a field in the main report.
 
Here's the problem that I'm running into.  I was able to get this shared variables stuff to work, except for one thing. In the lower-right hand corner is a figure: 2,220. This is the total field that I need (i.e. "Customer Totals"). But, it should be 2,220 plus 1,098. What's happening is that the Customer Totals field is only pulling the first record (i.e. the first inventory item in the report for each customer).  For this particular customer, there are two inventory items: one for a quantity of 2,220 and the other for 1,098.  The Customer Totals field should add these two fields together. But, it should be totaling all items for each customer.  It should be adding 2,220 plus 1,098.

I am using these shared variables, as best as I can. I don't know what further info to give other than to say that the subreport is in Group Header 2 which represents customer ID, the header declaring the shared variables is in the Report Header, and my Customer Totals field is in Group Footer 2. 
 
Any ideas?
 
IP IP Logged
TheBig1980s
Newbie
Newbie


Joined: 13 Nov 2008
Location: United States
Online Status: Offline
Posts: 4
Quote TheBig1980s Replybullet Posted: 20 Apr 2010 at 1:56am
"Anyone?  Anyone?"
------Ben Stein,"Ferris Bueller's Day Off", ca.1986
 
IP IP Logged
Savan
Senior Member
Senior Member
Avatar

Joined: 14 Dec 2007
Location: India
Online Status: Offline
Posts: 162
Quote Savan Replybullet Posted: 20 Apr 2010 at 2:12am
are you using the following syntax while adding the total
 
shared numbervar tot := shared numbervar tot + {field name}
shared numbervar tot;
 
Savan
Thanks
Savan
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.