Print Page | Close Window

Subreport group summary to Main Report

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22616
Printed Date: 29 Mar 2024 at 3:34am


Topic: Subreport group summary to Main Report
Posted By: Kuneho
Subject: Subreport group summary to Main Report
Date Posted: 05 Jun 2018 at 10:47am
Question: How to get the value of SubReport Summary Group to Main Report - Crystal Reports


I have a Subreport group by "Service" and create a Share NumberVar condition to get the average total of per Service.

Formula: WhilePrintingRecords; Shared NumberVar ServiceCO := ({#%Service}/2);

Note: {#%Service} - is running totals in Subreport place in Group Footer1 = Service

I need to refer the value of "ServiceCo" to the main report details with a condition depending if the service average from subreport is equal to main report service then I will get the value of "ServiceCO"

Currently, I was able to link the subreport properly in the main report and get the value but the problem I only get the value of Service#5 average (i.e. 9) but there are Service 1 to 4 with different value.

Can you please help me how to use Shared NumberVar in Main report to get the different value? or other solution please, if Shared NumberVar wont work

I also need the value of Spine = 13, Plastic =12 , etc.



Replies:
Posted By: kevlray
Date Posted: 06 Jun 2018 at 4:37am
Okay,the only way to pass information to and from a subreport (exception is parameters that can be passed from the main report to a subreport), is to used shared variables.  So a shared variable only holds one value at a time (i.e., if the sub report is in a group footer, then the shared value can be set by the sub report when the report processes the group footer and thus when the group footer is processed again, then the shared variable will get a new value.).  I think you can pass a shared array (there are limits to arrays).

I hope this helps.


Posted By: Kuneho
Date Posted: 11 Jun 2018 at 4:22am
Thanks for the reply Kevlay
I would be grateful if you or somebody can help me do the coding? I'm not a programmer and not good a coding condition.
Can you please help me out.
Thanks so much



Print Page | Close Window