Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Crystal sub report value on main report

Posted on 2014-01-17
3
Medium Priority
?
6,594 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
3 Comments
 
LVL 23

Assisted Solution

by:Ido Millet
Ido Millet earned 600 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 1400 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

971 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