Solved

Passing parameter values from main report to subreport

Posted on 2003-10-21
8
1,086 Views
Last Modified: 2007-12-19
I have an unlinked subreport that needs the same parameter values as the main report at runtime. I have tried using shared variables and the values seem to get passed to the subreport OK. However the shared variables are not available to be selected in the formula editor when I am using the selection expert for the subreport.

Any suggestions? Thanks
0
Comment
Question by:slimchance99
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 9593693
I haven't used variables very much.  Are local variables available in the select expert?

How are you calling the reports?

mlmcc
0
 
LVL 7

Expert Comment

by:ladylinet
ID: 9594064
Check your declaration for shared variables (this is Basic syntax, Crystal one is similar):

WhilePrintingRecords
Shared intCounter As Number
formula = intCounter

 mlmcc, shared variables are not same as local variables - they are shared between main report and subreport;and  they have to be declared on both places...

Lady Linet
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 9595906
I know the difference between shared and local but I haven't had reason to use them so I was wondering if local variables were available in the select expert.

mlmcc
0
 

Author Comment

by:slimchance99
ID: 9598266
The shared variable is declared in both the main report and the subreport. The value is getting passed from the main to the subreport OK. The shared variable is not available as a report object in the Select Expert though. How can I use the value of the variable to select records in the unlinked subreport?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 100

Expert Comment

by:mlmcc
ID: 9603591
If it isn't available in the select expert, is it available to a formula?  You could create a formula that just returns the value and maybe use the formula in the select expert.

mlmcc
0
 

Author Comment

by:slimchance99
ID: 9607244
It is already a formula - the formula is not availabe in the select expert, even though the formula exists in the subreport

slimchance99
0
 

Accepted Solution

by:
Max88Can earned 125 total points
ID: 9607651
I may have misunderstood the problem but to me I would recreate the same parameters that are in the main report in the subreport and then use the edit subreport links to join the specific parameters together (making sure that the "Select data in subreport" checkbox is not checked).  The new parameters in the subreport will be available to the select expert and formulas.  

If some these parameter values have to be manipulated and brought back to the main report then that is when I would use shared variables.

0
 

Author Comment

by:slimchance99
ID: 9608641
Perfect! That is exactly what I needed. sometimes it's too easy to look for the complicated solution when a simple on will do.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Report Error 14 72
Select Cross-tab total 2 54
Crystal Reports Repeat Report Footer X amount of times 6 29
Cyrstal Reports formula to check IsNull 8 21
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 is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

948 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

21 Experts available now in Live!

Get 1:1 Help Now