Solved

Shared Variable from Subreport to Main report

Posted on 2008-10-15
3
3,167 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 101

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 101

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

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

705 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