Solved

Passing Crystal Reports Parameter to subreport filter

Posted on 2006-07-17
5
36,119 Views
Last Modified: 2011-08-18
I have a crystal report with two subreports.  The subreports are different summaries of the numbers shown on the main report (i.e. should be looking at the exact same data).  One of the parameters on the main report is 'Branch', a list of cities where the user picks one which is then used with an 'if' statement in the main report to filter a list of delivery routes (Chicago branch = routes 3,4,7; New york Branch = routes 1,12,19,45,47; etc).  

I need to use that same filter on the subreport but can't get it to see that 'Branch' parameter so I can do the same 'if' in the subreport's filter.  As 'Branch' doesn't really exist in the data, I can't use the normal subreport link to get it that way.  

I can get the subreports to see the 'Branch' parameter to display it using a formula fild such as:

WhilePrintingRecords;
Shared stringvar MyBranch;
MyBranch

but in the select expert it errors on the 'while printing...' line, and yells at me about using a shared variable.  I can set it up without the shared, but then it thinks it is defining a new variable and the Branch sting is empty.

Any thoughts?
0
Comment
Question by:baytowel
  • 2
5 Comments
 
LVL 42

Expert Comment

by:frodoman
ID: 17122890
The best process here is to create a Branch parameter *in your subreport* and use that in your Select Expert just like you do in the main report.  Rt-click on the subreport and choose 'Change Subreport Links' and you'll be able to link the parameter in the main report to the one in the subreport (so your user doesn't have to answer two parameter prompts).

Shouldn't be any more to it than that, but let me know if you need further assistance.
0
 

Author Comment

by:baytowel
ID: 17124700
Thanks, Frodoman.  

That did the trick.  Awesome - I appreciate the help!
0
 
LVL 42

Accepted Solution

by:
frodoman earned 250 total points
ID: 17125078
Glad to help.
0
 

Expert Comment

by:anson2008
ID: 21196327
While using subreport in crystalreport VB2005 I am using subreport links for filtering the data based on the main report. But in my home PC its always asking the parameter value while running but its working fine in office PC

is there is any solution for it

thanks in advance
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

17 Experts available now in Live!

Get 1:1 Help Now