Solved

Passing Crystal Reports Parameter to subreport filter

Posted on 2006-07-17
5
36,183 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
[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
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Problem Statement In an SAP BI BO Integration project when a BO universe is built on a BEx query, there can be an issue of unit & formatted value objects not getting generated in a BO universe for some key figures. This results in an issue whereb…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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