Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Calculate data from subreports Post Reply Post New Topic
Author Message
crystalnewbie33
Newbie
Newbie


Joined: 08 Jan 2014
Online Status: Offline
Posts: 29
Quote crystalnewbie33 Replybullet Topic: Calculate data from subreports
     Posted: 02 Jun 2014 at 8:22am
Hello. Is there a way to extract data from a sub report and use it in a formula in the main report? My main report performs a calculation for a head count and then the sub report performs another calculation for a head count. I want to subtract the two results and show them at the bottom of the main report. The 2 reports come from 2 different MySQL tables that have the same field name, 'SPECIES.' I need to group by this field name and am unable to link the two tables-when I do, I get incorrect numbers for my calculation. I thought that a subreport might get the desired result but I'm not sure how to do this. Any help very much appreciated.
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet Posted: 02 Jun 2014 at 9:05am
You can get values from a sub-report by creating shared variables (assign the value in a sub-report formula).  You will not be able to group by this value in the main report (grouping is done before sub-reports are run).

I hope this helps.
IP IP Logged
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