Print Page | Close Window

Dynamic Parameters

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=17187
Printed Date: 02 May 2025 at 2:19pm


Topic: Dynamic Parameters
Posted By: andorfuhrer
Subject: Dynamic Parameters
Date Posted: 02 Aug 2012 at 1:13am
Hi

My database contains a table that has multiple tables within itself. For example, this table is called MedLists. Medlists contains doctor names, facilities and insurance carriers. Medlists contains categories that allow you to specify what record type you want (If you want doctor name, you filter for a category of DOCTORNAME).

How do I create a dynamic Parameter that will just prompt users for the values of Doctor Names?? Currently, the parameter is listing ALL the values in Medlists, (facilities and insurnaces) not just doctor names.


THANK YOU IN ADVANCED!!!


-------------
AF



Replies:
Posted By: hilfy
Date Posted: 02 Aug 2012 at 8:38am
I would add a select filter to the table to filter it by category = "DOCTORNAME" (hardcoded).  If that doesn't work, there may be a way to do this using a command.
 
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics


Posted By: andorfuhrer
Date Posted: 02 Aug 2012 at 11:19am
Thanks!
I never dealt with Commands but Im giving it a whirl -
I created this command:

SELECT description
FROM Medlists
Where tablename = 'Specialty'

I am getting this error message when I try and run the report:
FAILED TO RETRIEVE DATA FROM THE DB
DATABASE CONNECTION ERROR: IF TABLES ARE ALREADY LINKED THEN THE JOIN TYPE CANNOT CHANGE

Do I have to take this command and link it back to Medlists?
Can I also just do a parameter within the command that will prompt the user to pick the 'description' from the command. Obviously I would have to say desctiption= {?Parameter}...


Thanks again! sooo helpful!!!! :)

-------------
AF


Posted By: hilfy
Date Posted: 03 Aug 2012 at 7:17am
I'm not sure what that error means....  You may have to look at your existing links
 
I would use this command for the dynamic parameter only - don't link it to anything and don't use its fields in the report except for in the parameter.  That way it would not be included in the SQL that the report runs and instead will only run for the parameter values.
 
Yes, you can add parameters to the command.  You have to create them IN THE COMMAND EDITOR, not in the report (commands require some additional internal properties in the parameter that are not set up when creating them in the report.)  If the parameter is a string value, you'll have to put single-quotes around it when you put it in the query.  It will look something like this:
 
description = '{?Parameter}'
 
-Dell
 


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window