[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Passing parameter values from main report to subreport

Posted on 2003-10-21
8
Medium Priority
?
1,097 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
[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
8 Comments
 
LVL 101

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 101

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
What’s Wrong with Your Cloud Strategy ?

Even as many CIOs are embracing a cloud-first strategy, the reality is that moving to the cloud is a lengthy process and the end-state is likely to be a blend of multiple clouds—public and private. Learn why multicloud solutions matter in this webinar by Nimble Storage.

 

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
 
LVL 101

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 500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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. …
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

649 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