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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summarizing shared variables

Status
Not open for further replies.

dnboughton

Technical User
Oct 26, 2005
14
US
I have CR 8.0, Oracle db

I will try and explain my question as best that I can, as I'm a little green when it comes to shared variables.
I have a report with two shared variables from a subreport in my main report.
I have two groups in my main report. G1 - Shop, G2 - LaborName. The subreport is placed in D1 (Hidden). sharedvars are placed in GF2 (LaborName)to give totlaborrate and total labor hours. I want to create a subtotal and a grand total for sharevar1 (LabHrSaved)to place in GF1 and RH. I also want to create an averagefrom sharevar2 (RateSaved)and place in GF1 and RH.

thanks in advance,
Wizzy

 
Place this formula in the GH1:

numbervar TotLabHrSaved:= 0

Right click the GF2 and select insert section below.

Place the following formula in the new section (after the subreport):

shared numbervar LabHrSaved;
numbervar TotLabHrSaved:= TotLabHrSaved+LabHrSaved

Now you can reference the variable in GF1

numbervar TotLabHrSaved

Additionally you would want a count of the successful executions of the subreport for doing the average, so place another variable in GF1 such as MyCounter and also reset it to zero, then increment it in the subreport by 1, as in:

shared numbervar MyCounter := MyCounter+1

-k
 
This didn't work. Returned values are 0.00 Hrs for each G1.
 
Nevermind...I got it thank you. I'll try the average now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top