2 Subreports sharing the same link to the main report

Previous topic answered : http://rdsrc.us/lCZiFR, and I want to ask if I have 2 subreports and want to share the same link - is this possible. Currently with on linking of the subreport 1 to a field in the main report gives the right value but when I add a second subreport and also share the same link to the same value in the main report my value changes.

Can this be done.
John-S PretoriusTechnical Service Manager, Mid-AtlanticAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

James0628Connect With a Mentor Commented:
If you're using a subreport just to set some shared variables and it's not producing any output that you need to see on the report, you can't just suppress the subreport, or the section that the subreport is in.  If you do that, the subreport won't be executed and any shared variables in the subreport don't get set.

 What you need to do is:

 Make the subreport not produce any visible output.  The simplest thing is to just suppress all of the sections in the subreport.  Any formulas in those sections should still be evaluated (so the variables should still be set).

 Back in the main report, right-click on that subreport and select "Format Subreport" and on the Subreport tab, check the "Suppress blank subreport" option.

 Go to the Section Expert for the section that the subreport is in and check the "Suppress Blank Section" option.

 If you do that, then the subreport is run and sets the shared variables, but it's blank, so the subreport is suppressed, and then the section is suppressed because it's blank.

 This is what mlmcc was referring to in his first post.

 Obviously, if you have more than one subreport in the same section, you'll need to do the first two steps for each subreport.  And if there are other fields in the same section as the subreport, they'll need to be suppressed, or not produce any visible output, so that the section is blank.

John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I actually found by adding another Group Header and placing the second subreport in there and linking to another copy of the same field works without changing the data. Now that I have 2 subreport which I'm 'hiding'. This approach doesn't give me much 'cleanliness' with the spaces between Groups or even when I export to Excel - any suggestions how to make a report with subreport carrying over values look a little cleaner ?

Are the subreports blank when they display?
If so you can format them to suppress when blank.  You can also suppress the section when blank

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
The subreports - not blank -  are being 'tweaked' text shrunk to smallest height then I change the color to white.

Suggestions with 'exporting' to excel ?
mlmccConnect With a Mentor Commented:
You can't change the exporting to excel.

Why if you don't want the subreport to show anything do you have it display anything?
What is the subreport doing?

John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
If I hide the Subreport the values in the main report disappear - Previous question : http://rdsrc.us/lCZiFR - The subreport carry's values over into the main report header, I then have formulas which use these values from the subreport.

Am I doing something wrong maybe ?
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Below is 'work in progress', I would like to know if I'm maybe doing something wrong here - appreciated.

John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Thank you guys, James your explanation describes mlmcc's suggestion perfectly.
FWIW, I'd have probably given some points, if not most of them, to mlmcc's first post.  That had the basics.

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.

All Courses

From novice to tech pro — start learning today.