Solved

Shared Variable from Subreport to Main report

Posted on 2008-10-15
3
3,152 Views
Last Modified: 2012-05-05
I have a report with about 5 details sections which are for the most part subreports.  I have created a subreport which is retreiving survey information for incidents.  The survey report displays the results of the survey in a summarized format as there are multiple questions.  I created a shared variable in the subreport as follows:
WhilePrintingRecords;
Shared numberVar TotalYes1 := {@Sum Comment1}

I then created a formula in the main report with the following details

WhilePrintingRecords;
Shared NumberVar TotalYes1;
TotalYes1

I placed this formula in a details section that I added below the details section that has the subreport.  The problem I am getting is that the shared variable (likely the first one evaluated) is appearing in the details section of the report however it is appearing for every detail record that appears even if there are no subreport results?
Any help is appreciated.
0
Comment
Question by:siocco1
  • 2
3 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 22722492
You need to conditionally suppress the value.

You could suppress if 0 - check the FORMAT FIELD --> Number
Custom format

Another way would be to reset the value before the subreport to say -1 then you suppress if it is still negative.

In the first detail sectiion before the subreport
WhilePrintingRecords;
Shared NumberVar TotalYes1;
TotalYes1 := -1;
''

Conditionally suppress the display formula

WhilePrintingRecords;
Shared NumberVar TotalYes1;
TotalYes1 = -1

mlmcc


0
 

Author Comment

by:siocco1
ID: 22723073
Why would i need to supress the value?  If the subreport is empty, would it not pass an empty string or not do anything?  
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 300 total points
ID: 22723617
No,  It would either set the value to 0 or leave it alone.

mlmcc
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now