Solved

Passing Crystal Reports Parameter to subreport filter

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dynamic reporting tools 4 111
Linking to Report Server Shared Data Source 4 112
Referencing a dataset field 1 99
SSRS report builder 3.0 6 41
I recently went through setting up a JasperReports Server using the AWS EC2 instance, and this article will cover some basic administration tasks I had to perform.
How to increase the row limit in Jasper Server.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.

803 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