I am trying to use a total from a subreport in CR v10 and am not sure if what I'm trying to do is possible...here's the details:
I've created a main report that links to a subreport by SKU and displays quantity on hand at our distribution center in the main report by creating the following:
//DETAIL-formula for shared variable used for detail section
WhilePrintingRecords;
Shared NumberVar DCQOH;
//ACCUM-formula used in suppressed section GF1a
WhilePrintingRecords;
Shared NumberVar DCQOH;
Shared NumberVar TotalDCQOH;
TotalDCQOH:= TotalDCQOH + DCQOH
//DISPLAY-formula used in GF1b
WhilePrintingRecords;
Shared NumberVar TotalDCQOH;
The problem is that I allow the user to choose how the report is grouped. When the user chooses to group by SKU, this all works great.
SKU DC QOH
abc 100
def 200
ghi 300
Total 600
However, when they choose By Store/By SKU then the QOH in the total uses the duplicated data when summing (as it should):
Store SKU DC QOH
1 abc 100
1 def 200
1 ghi 300
2 abc 100
2 def 200
3 ghi 300
What I get:
Total 1200
What I want:
Total 600
I also tried creating a whole new subreport that totals the SKUs before returning the data, however I run into issues with that too. If I link by SKU then I only see the last qty in the main report. If I don't link, then the subreport gives me a total for more than I originally displayed on the report (because I have additional parameters in the main report.)
Sorry so verbose, just wanted to make sure I gave enough info. Any help is much appreciated...thanks!
I've created a main report that links to a subreport by SKU and displays quantity on hand at our distribution center in the main report by creating the following:
//DETAIL-formula for shared variable used for detail section
WhilePrintingRecords;
Shared NumberVar DCQOH;
//ACCUM-formula used in suppressed section GF1a
WhilePrintingRecords;
Shared NumberVar DCQOH;
Shared NumberVar TotalDCQOH;
TotalDCQOH:= TotalDCQOH + DCQOH
//DISPLAY-formula used in GF1b
WhilePrintingRecords;
Shared NumberVar TotalDCQOH;
The problem is that I allow the user to choose how the report is grouped. When the user chooses to group by SKU, this all works great.
SKU DC QOH
abc 100
def 200
ghi 300
Total 600
However, when they choose By Store/By SKU then the QOH in the total uses the duplicated data when summing (as it should):
Store SKU DC QOH
1 abc 100
1 def 200
1 ghi 300
2 abc 100
2 def 200
3 ghi 300
What I get:
Total 1200
What I want:
Total 600
I also tried creating a whole new subreport that totals the SKUs before returning the data, however I run into issues with that too. If I link by SKU then I only see the last qty in the main report. If I don't link, then the subreport gives me a total for more than I originally displayed on the report (because I have additional parameters in the main report.)
Sorry so verbose, just wanted to make sure I gave enough info. Any help is much appreciated...thanks!