Solved

Passing parameter values from main report to subreport

Posted on 2003-10-21
8
1,085 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

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. …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 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

9 Experts available now in Live!

Get 1:1 Help Now