Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values from a sub report and using in formula

Status
Not open for further replies.
Mar 7, 2010
61
Hi

i have a report with some date and qty values (invoices). I have a sub report with some date and qty values (orders relating to invoices). i can view the order information from these invoices via the subreport. However I want to create some formulas to compare values from each report. e.g find the date difference between the invoice created date and the order due date to identify delivery performance. How can i create this formula using fields from both reports? I know how to create formula when looking at fields in the one report. Any help would be great. Thanks
 
Use a shared variable as per post from yesterday

"How to bring a value from sub-report to main report"

Ian
 
Another problem, not sure if it should be logged under a new thread? My values passed from sub report are within the details section. My formulas therefore using these values are in a group footer. I now have a formula comparing the two values in group footer and printing a 1 if true to my statement. I want to sum the value of these 1's if that makes sense however my formula cannot be summarised? Any suggestions?

Thanks
 
You need to use another Variable which increments by 1 based upon the conditions you describe.

Ian
 
Are you able to show me how I would do that? Thanks My statement is as follows:

if {SORD.TYP} = 2 and {@Date Difference} = 0 then 1
 
Modify Formula

whileprintingrecords;

global numbervar datediff;

if {SORD.TYP} = 2 and {@Date Difference} = 0 then
datediff:= datediff + 1 ;

Ian


 
Thanks Ian. I have attempted this and it works OK for an overall total. I neglected to tell you I have two groups and need a total for each group. If you could help with this it would be much appreciated. Thanks
 
Add a group count to formula

whileprintingrecords;

global numbervar datediff;
global numbervar datediffgrp;


if {SORD.TYP} = 2 and {@Date Difference} = 0 then
datediff:= datediff + 1 ;

if {SORD.TYP} = 2 and {@Date Difference} = 0 then
datediffgrp:= datediffgrp + 1 ;

In group header add a reset formula and suppress it.

whileprintingrecords;

global numbervar datediffgrp:=0;


Ian
 
Have been on holidays. Found another problem. Not sure if should keep in this thread? I have my orders delivered column which checks if it is an invoice and if so returns a 1. I then sum the 1's to get my number of orders delivered for each group. However just realised where there is more than one record for each invoice my sum is incorrect as it shows 2 orders delivered when there is only one order delievered with 2 products on it. I am not sure how to only return a 1 for each invoice (e.g where the invoice changes). Knowing the rest of my report, are you able to help? thanks, much appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top