Link to home
Start Free TrialLog in
Avatar of Tina K
Tina KFlag for United States of America

asked on

Crystal Reports SubReport Placement

I have a subreport that through a series of variables and formulas is performing a vlookup of sorts.  It's working great - EXCEPT - due to the placement of the subreport, my final column is pulling it's value from the subreport below it.

So, looking at the screenshot attached , the column CRU EFF is looking into the subreport.  Based on the date in Eff M-YY, it's pulling the matching record for that date (through variables and record selection in the subreport).  It then looks at the material type in cru and pulling the corresponding index number from the subreport  data table.  First group of data should be cru-CRU HR, eff m-yy, 10-2014, CRU EFF, 32.55
What I'm seeing is that the second row of records on my main report is pulling the data from the subreport above it.  It should be pulling it from the one directly below it.  It's very clear what it's doing when you look at the third set of records.  Based on the date of 1-2015 and cru of CRU GV, it should be populating 35.80 on column CRU EFF - instead it's grabbing the CRU GV pricing from the subreport occurrence above it.
I've shuffled this subreport in every possible area of the report, but everywhere else only pulls records corresponding to the first record (dated 10-2014).    I've even tried sticking it in the details section right next to the CRU EFF field to see what I get - still doesn't work.
Any suggestions are greatly appreciated!

User generated image
ASKER CERTIFIED SOLUTION
Avatar of Tina K
Tina K
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tina K

ASKER

Subreport must be positioned to run prior to details of main report being populated due to needing values assigned to variables.  Inserting an additional detail section and inserting the subreport in details A solves the problem, along with specifying that the variable values are assigned 'while printing records'.