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

Value from subreport to main report..

Status
Not open for further replies.

DianaStewart

Programmer
Apr 16, 2002
58
CA
I am using Crystal reports 7.0. The shared variable values from the subreport are being passed to the
main report only problem is it is giving me the value for the last name rather than for each name...



Sub report contains:

Group Header 1 (Table1.Group)
Group Header 2 (Table1.EmployeeName)
Group Header 3 (Table1.DateEntered) - contains Formula1

Formula1 :

whileprintingrecords;
if month({Table1.DateEntered}) = 1 then
shared numbervar Variable1 := Sum ({@NewNumbers}, {Table1.DateEntered}, "monthly")


When previewing the subreport the values are correct for each Name and month...


Main Report:

Group Header 1 (Table1.Group) - contains the subreport
Group Header 2 (Table1.Nickname)

In the Group Footer I have Formula2:

whileprintingrecords;
shared NumberVar Variable1;
Variable1


The value being carried over is the values for the last name. Do I have to reset each variable
at each Name? If so, where do I do this?


***One other question, my subreport is not linked to any fields in my main report. Do they have to be linked?





 
Which group footer?

"In the Group Footer I have Formula2:

whileprintingrecords;
shared NumberVar Variable1;
Variable1"

Since this:

"shared numbervar Variable1 := Sum ({@NewNumbers}, {Table1.DateEntered}, "monthly")"

is grouping at the dateentered level, and your displaying at the table1.group level, logically you should receive the value only once per table1.group.

Perhaps if you share the data that you have and the results that you want it would be easier to resolve this.

-k


kai@informeddatadecisions.com
 
The group footer 1 which can be found in the Main report. You are absolutely correct that the value is appearing once. In other words the last name, the variable takes that value from the last name listed and displays it... how can i get around this or what do you suggest ?
 
synapsevampire,

What do you suggest. Is there a way to accomplish what I am trying to do?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top