5 pts.
 Suppress Subreport without clearing shared variable values
I have a report (Crystal Reports XI R2) that contains one subreport that passes values back to my main report. I wish to suppress (not show) the subreport on my main report; however I wish to use the values from the shared variables (4 total shared variables). As it is, when I suppress or hide the section in the main report where my subreport is, then it clears (zeroes) out my shared variable values. Can someone please help me?

Software/Hardware used:
Crystal Reports XI R2
ASKED: May 27, 2010  3:28 PM
UPDATED: May 30, 2012  3:57 PM

Answer Wiki:
As you found out if you suppress the subreport it no longer runs. What you need to do is on your subreport hide all of the fields. On the main report right click on the subreport and click on the last tab. Check the suppress blank subreport checkbox. This will allow your shared variables to still run without showing them. Their will still be a blank space on your main report. If you want to get rid of that go into the section export, and for the band which has the subreport in it, select underlay following section and suppress blank subreport. Now you will not have an empty space either.
Last Wiki Answer Submitted:  May 29, 2010  12:43 pm  by  Jade1977   440 pts.
All Answer Wiki Contributors:  Jade1977   440 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Jade1977 Thankyou so much… Solves a lot of headaches for me… Awesome

 10 pts.

 

Hurray!

This solves the issue, wich I have been looking high and low for an answer to. This was the trick needed. :D

An addition: You also have to turn off “can grow” on the first tab of format on subreport to finally hide the section.

Thank you Jade1977!

 10 pts.

 

I have a shared variable(e.g., $order total) which passes from a subreport group subtotal linked to the corresponding field (order number) in the main report. Some of the orders in the main report do not have a corresponding value in the subreport. If an order doesn’t exist in the subreport, the previous existing $order total from the sub report incorrectly gets used in that order’s calcs until the next subreport order number comes up. I’ve tried to vary the location of the passed variable in the main report. What is the syntax to reset the variable to zero after each order number but still grab the calc from the next order in the subreport?

Here’s the syntax I used to reset the variable:
shared numbervar Y:=0;

This causes the value to stay at 0 and not pass the correct value for other calculations.

 10 pts.

 

helpful post m , i look this good after 2 year and worked like a charm.

 10 pts.