Skip to Content
0
Former Member
Jan 14, 2018 at 09:52 PM

Global Variables Loosing Scope?

109 Views

To The Community:

I am currently developing a CR 2008 report (I know we're dinosaurs) where I am attempting to extract employee Roth deferrals and Safe-Harbor contributions from our Oracle database. I have two "Global CurrencyVar" variables declared and initialized in the top-most group which is the SSN. I then group my records according to a field called GRPTYPECD which value is either "EE" (employee) or "ER" (employer). Next, I group my records according to a field called "ROTHCONTRCD" which is either "Y" or "N" indicating if the associated record is Roth deferrals. ROTHCONTRCD is "Y" only if GRPTYPECD=EE since Roth money is employee contributions.

Then, in my first footer group which is the Roth, I have a simple formula "RothContribAmt := {dbfield}; " where I put the database field value into a Global CurrencyVar variable. This group has a suppression formula based upon the above criteria (GRPTYPECD<>EE Or ROTHCONTRCD=N).

My next group is for my Safe-Harbor where I do essentially the same only storing the value into a differently named variable. This group also has a suppression formula based upon the above criteria (GRPTYPECD<>ER Or ROTHCONTRCD=N).

My debug data shows the report correctly grouping and filtering the records and placing the values into the variables BUT ...

...when it drops down to the report data line and I attempt to output my two variables they are zero! If I change the scope to "Shared" I get whatever the last database record value was IN BOTH VARIABLES. It's almost as if CR is getting confused in the variable pool.

Any help is greatly appreciated!!

James