Link to home
Start Free TrialLog in
Avatar of Jeremy Campbell
Jeremy CampbellFlag for United States of America

asked on

How to create Dynamic Parameter using fields from two tables AND retain drop-down information?

I have two tables connected by primary foreign key. One table has product type name while the other table has product name. I want to create a dynamic parameter using both of these, but it seems that when using these fields from two different tables I lose the drop downs, and the data must be entered by the user manually. When I create the parameters individually, they work fine and have the drop downs, but when cascading them as a dynamic, the drop downs are gone.
Avatar of Kurt Reinhardt
Kurt Reinhardt
Flag of United States of America image

You definitely should be able to use cascading parameters from different tables.  I just did so in a test report.  How are the tables joined (Inner or Outer) and are you allowing multiple value selection?

~Kurt
Avatar of Jeremy Campbell

ASKER

I am using Inner join, not enforced. And I tried both multiple values and discrete values. Either way the drop downs did not show up.
Note: The cascading is working correctly, we just don't have the drop downs.
Avatar of Mike McCracken
Mike McCracken

If you don't cascade them, do the dropdowns work?

mlmcc
Can you create a view and use this as your source?
mlmcc,

I created two seperate Dynamic Parameters and added only one field to each one to create them uncascaded. When I do this, the dropdowns do work. We tested that previously but determined it would not be effective as the results are not filtered as you work down through each drop down.

dcurry22,

I am not sure what you mean by creating a view and making it the source. Can you provide more details please. I apologize as I am rather new with Crystal.
My line of thinking was that you could create a view that marks both the first and second values and your second query could be  based on the value of that column.  But, not sure that would qualify as "dynamic".  
Also, I forgot to ask, are you using CR inside of Visual Studio?
The Dynamic Cascading Parameters feature is not available in Crystal Reports for Visual Studio, but is available in one of the upgraded versions. (Crystal Reports and CR Server/ Business Objects Enterprise)

There are other answers to your questions within Experts-Exchange which address this using a sub-report. I am not familiar enough with sub-reports to be of much help but thought you could reference these.  
Is the problem in the Crystal designer or when you run the report?

What version of Crystal?

mlmcc
I appreciate your guys' help on this matter. I am working in Crystal Reports 2008. In the designer.. Not working in Visual Studio.

The problem is currently visible when refreshing the data in the designer and the parameters prompt comes up to select the data you want to see. I assumed since in designer the drop downs were not there that when another user runs the report (which would be in the viewer) would not have any drop downs either.
User generated imageUser generated imageUser generated imageUser generated imageUser generated imageUser generated image
FYI: This is training data..

The pictures represent the process I am using to create the parameter.

The two fields being used come from two different tables; Product_Type, and Product.
They are linked through Product Type ID.

Note: We have successfully used Product Type ID and Product Name from the table Product which does in fact create the drop downs, however the Product Type ID is not user-friendly. We would need to see the Product Type Name, which comes from the Product_Type table.
What .Net assemblies are you using?

mlmcc
Sorry misread your comment.

You have to select both field in the select expert.

First choose to use the product name tyoe the product name

mlmcc
Sorry just getting back.. Let me give that a try and get right back..

Thanks
Still didn't get the drop downs.. Unless I didn't setup correctly in Select Expert.. Here is the screenshot...
SP32-20110307-130255-585.jpg
That looks right.  I don't know why it is behaving that way.

mlmcc
Ok, just wanted to make sure I had that right.. So, still no idea why this is preventing drop-downs? We ran into this while I was getting trained on how to use the software and decided to attack this issue since it will most likely be something we will be requiring in the future.
Most of the reports I have written use static parameters for 2 reasons.
1.  they are for systems using CR 10 or before (no dynamic pararmeters)
2.  The reports will be run inside another application that is handling the parameter prompting and passing.

You are doing this in the CR2008 designer and not through an application?

I don't have CR2008 but will try it in CR XI

mlmcc
Yes, we are creating the parameters through Crystal 2008. Thanks again for all your time!
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
are you saying to add the parameters without cascading? If so, this does work.
No, cascade them.  I assume the tables are joined.

mlmcc
Okay, let me try to recreate using completely different data sources, but the same scenario.. I'll get back shortly.
Well it works in the live database.. Using data from two different tables the cascading is working and the drop downs show up.. I don't understand why the sample data acted differently..  Thanks again for all your help!
It should have been working to begin with.. Something may have been wrong with the sample database but it would work the way mlmcc described..