Solved

Shared Variable from Subreport to Main report

Posted on 2008-10-15
3
3,164 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

726 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