?
Solved

Passing Crystal Reports Parameter to subreport filter

Posted on 2006-07-17
5
Medium Priority
?
36,206 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 1000 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

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…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 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