Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Subreport variable printing wrong in main report

Posted on 2004-10-21
Medium Priority
Last Modified: 2012-08-13
I have a subreport which calculates a value. I set up the shared variable there and then use that to append values onto a total. The subreport is placed in a group header. I then create a formula in the main report to view that shared variable and place it in the same group section but just after the subreport yet it prints the value on the next group header. Does anyone know where I may be going wrong here?
Question by:TerraKeith
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 28

Accepted Solution

bdreed35 earned 2000 total points
ID: 12373237
Divide the the group header section into 2 sections.
Right click the group header name in the left margin of the report and choose Insert Section Below.
Move your formula that references the shared vairable into the lower section (group header section b) and leave the subreprt in the a section.
Your formula should be correct now.
LVL 42

Expert Comment

ID: 12373456
Brian is correct.  The reason for that is because you cannot reliably determine the order fields will be evaluated within a section.  Usually it works top to bottom but you can't depend on it.

Section A will always be processed/evaluated before Section B so by splitting it you insure they're evaluated in the correct order.


Author Comment

ID: 12373702
The only problem with that is that I need to know the value of the variable returned so I can suppress the group section header and if so it's details section as well.
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 28

Expert Comment

ID: 12374468
Does your subreport only calculate the variable to determine if you should suppress or not?

The subreport has to run in order to calcualte the shared variable, so you can't suppress the section that contains the subreport.
You can suppress group header a, the details, and group footer based upon the shared variable.

If you subreport only present to calculate the value, then suppress all the sections in the subreport except one of the report footers.
In the main report, make the subreport and the group header a section hieght as small as you can.  Also, right click the subreport, choose format, and under the comnon tab, make sure the can grow proprty is not set.

Does this help at all?

There are some more complicated alternatives that can be explored if need be.

Author Comment

ID: 12377127
Thanks for the help

Author Comment

ID: 12377130
It worked a charm

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question