troubleshooting Question

crystal reports shared variable works until i try to add it to a another field

Avatar of mitai
mitaiFlag for Canada asked on
SoftwareCrystal Reports
13 Comments1 Solution671 ViewsLast Modified:
hi experts

i have a report that is made up of 3 subreports.  the subreports run for each detail line of the main report.  They are located in the detail a, detail b, and detail c sections.  Each of these subreports display a bunch of details and then create a shared variable that is passed back to the main report.  This shared variable will display on the detail d section but if I try to add it to another field from the main report it turns to 0.  Not sure why this is happening.

I am using the following code to assign and display the shared variable

assign

shared numbervar nVariablename:= sum({fieldname});

display

shared numbervar nVariablename;
nVariablename

display with addition (this is the one that doesn't work.  if I have a display one on the line it will also zero out the display one that was working before i add a addition to another field)

shared numbervar nVariablename;
nVariablename + {Reportnumberfield}


Any thoughts or direction would be appreciated as it is driving me crazy.

Ian
ASKER CERTIFIED SOLUTION
mitai

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros