Print Page | Close Window

How do you create formulas from sub-report fields?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
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=10312
Printed Date: 01 May 2024 at 9:44pm


Topic: How do you create formulas from sub-report fields?
Posted By: BadBoyHouse
Subject: How do you create formulas from sub-report fields?
Date Posted: 21 Jun 2010 at 5:48am
I have my main report which also uses a sub-report.
 
I need to create some formulas that calculate figures in both the main report and sub report.
 
For example:
 
Main report field AMOUNT + Sub Report field AMOUNT.
 
Can anyone tell me how to create formulas based on fields/formulas held in sub-reports



Replies:
Posted By: rahulwalawalkar
Date Posted: 21 Jun 2010 at 6:19am
Hi
 
*Create a formula in subreport and main report
*To pass values from main to sub report and subreport to main declare the variable as Shared variable
*Check Crystal Reports help for more information
 
Cheers
Rahul


Posted By: BadBoyHouse
Date Posted: 21 Jun 2010 at 11:00pm
I've almost got it working, however the figures are not correct:

Column 1 - main report - 77462.19
Colum 2 - from sub report shared variable - 0.00
Column 1 - main report - 358038.39
Colum 2 - from sub report shared variable - 77462.16
Column 1 - main report - 236918.00
Colum 2 - from sub report shared variable - 358038.37
Column 1 - main report - 359993.77
Colum 2 - from sub report shared variable - 236918.00

For some reason the first line in column 2 is showing 0.00 - and this is throwing all of the other lines out as you can see.
Any ideas why this might be?



Print Page | Close Window