Print Page | Close Window

Passing a total from subreport 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=21893
Printed Date: 29 Apr 2024 at 2:39am


Topic: Passing a total from subreport to main report
Posted By: danahawk
Subject: Passing a total from subreport to main report
Date Posted: 26 Feb 2016 at 6:51am
Does anyone have an simple example of passing a total from subreport to main report?



Replies:
Posted By: kevlray
Date Posted: 29 Feb 2016 at 4:34am
I do not have a ready example.  But here is basically the procedure.  Have a formula in the sub-report that assigns the total to a shared variable.  Then in the the main report have another formula that has the same same shared variable defined and put that formula in some section following the section the sub-report is in.  See the following

In sub-report
Not sure if you just need a number or currency.  Also not sure how the total is defined.
shared numbervar somevariable := total;

In Main report

shared numbervar somevariable;



Print Page | Close Window