Suppress Subreport without clearing shared variable values

5 pts.
Tags:
Crystal Reports Subreport
Crystal Reports XI
Shared Variable
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Indy1910
    Jade1977 Thankyou so much... Solves a lot of headaches for me... Awesome
    10 pointsBadges:
    report
  • Uffe
    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 pointsBadges:
    report
  • Kitana
    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 pointsBadges:
    report
  • Kundula123
    helpful post m , i look this good after 2 year and worked like a charm.
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following