Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subreport doesn't run when section is supressed

Status
Not open for further replies.

Pejo

Programmer
Sep 18, 2001
15
GB
I have a report that uses a subreport to get a value that I need to calculate some averages. I use shared variables to get the result from the subreport to the main report and that works fine.
The main report has 3 group sections that summarizes the values from the detail section and the detail section is not to be displayed in the report. As long as the detail section (where the subreport is) is displayed the shared variables are correct but when I suppress the detail section the subreport doesn't run and I get no values in my shared variables.

I'm sure someone has had this problem before, so please help!


/PeJo (Using CR 8.5)
 
I have used shared variables in this nature before and have not run accross this problem. I put the subreport as is in the detailed section and then supress the subreport in the detailed section.
 
So how did you do it? I tried to create a new, simple report that has a subreport in the detail section and uses shared variables to display it in the group section of the main report. That works.
Then I suppressed the detail section and got zero in my shared variables! Same result if I suppressed only the sub-report in the main report.

/PeJo
 
If you display the subreport in the group section do you get the right answer. If yes do not supress the group section. just supress the report. Create a formula to access the shared variable and place that in the group section. If the right answer is displayed you can use the formula anywhere in the report.
 
If you suppress the subreport it won't run.

However, you can accomplish the same thing by suppressing all sections within the subreport except the report footer. Then suppress all of the fields in the subreport's report footer. In other words it becomes invisible even when it is running. (A 'stealth' subreport.)

The only thing is that it takes up a bit of space. To eliminate even the space you can place it into it's own section of the container report and use underlay. Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top