Solved

Crystal sub report value on main report

Posted on 2014-01-17
3
6,486 Views
Last Modified: 2014-01-21
I want to place a sub report value in a different section of the main report, does anyone know how?
0
Comment
Question by:HKFuey
[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
3 Comments
 
LVL 23

Assisted Solution

by:Ido Millet
Ido Millet earned 150 total points
ID: 39788284
As long as the target section is below the section where the subreport is, you can declare and set the value of a shared variable in the subreport.  Then, in a main report formula, declare the same shared variable.  Google "Crystal shared variables" for examples.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 350 total points
ID: 39788545
Ido is correct.  The biggest mistake report developers make with shared variables is they try to use the shared variables in sections before the subreport.

Crystal evaluates sections from the top down and subreports are the last objects evaluated in a section so the values from the subreport cannot be used until the section after the subreport.

Basic method I use
In the main report
Add a formula to the report header
WhilePrintingRecords;
Shared NumberVar mySharedNumber;
""

Open in new window


In the subreport add a formula
WhilePrintingRecords;
Shared NumberVar mySharedNumber;
mySharedNumber := Formula for the value;
""

Open in new window


In a section after the subreport to display the value
WhilePrintingRecords;
Shared NumberVar mySharedNumber;
mySharedNumber 

Open in new window


The WhilePrintingRecords line is not required.  Using Shared variables forces the evaluation to be in the printing pass.  However, I use it as a way to document when the formula is evaluated.

mlmcc
0
 

Author Closing Comment

by:HKFuey
ID: 39796813
Thanks for the help, these instructions are much clearer than the ones I Googled!
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

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…
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 …
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

627 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