• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Subreports and Variables

Hi Guys
I have been working on a report I like to call "subreport hell" at the moment.
Its a bit brutal and a little crude right now, but its almost doing exactly as designed

I am having trouble as I have a grid of subreports which are going away and extracting data for each historical year back to 2008 based on a value trn_cde.
The subreports all pass variables back to the main report for summing for each record.
Howver I am having trouble zeroing out the variables for the next record. Do subreports not run on a per record basis?
The first record is correct, but the subsequent records each have some values from the last record still being added up.

Can anybody offer advice. Its so close to be how I want it!

Screenshot shows all the subreports and the totals.
Its a bit ugly there are variables for each subreport passed back.
  • 2
  • 2
1 Solution
What section is it in?

Subreports run everytime the section runs.

If you need to 0 shared variables the best place might be in the subreport report header.
You can also do it in a section before the subreport section but it has to be a section at the same level (group header, detail, etc)

StratfrordDCAuthor Commented:
The subreports are all split into their own details section

What is happening is that even if the subreports  for the 2008 year go away and get nothing ( no values in the database ) the last time there was a variable value, it simply carries through those variable numbers. Distorting my results horribly.

Each subreport line has its own details section. I have tried resetting the variables in details section a and all the subreports before they pick up a value.

They are shared variables, but this is for summing purposes.
StratfrordDCAuthor Commented:
I just realised
Its most crazy mistake.

Where I was setting the variable to zero I was saying varLevy=0; instead of varLevy:=0; I was giving a boolen TRUE where i wanted to zero a variable!

I just need to look at my report with a fresh pair of eyes
thanks for your help mimcc.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now